134 lines
3.3 KiB
Plaintext
134 lines
3.3 KiB
Plaintext
# Generic 65C02 grammar with semicolon comments
|
|
|
|
scopeName: 'source.assembly.6502.6502-test'
|
|
fileTypes: []
|
|
name: '6502 TEST'
|
|
patterns: [
|
|
# { include: 'source.65c02-opcodes' } # include 6502 and 65c02 opcodes
|
|
# { include: 'source.6502x-opcodes' }
|
|
# { include: '#comments' }
|
|
# { include: '#symbols' }
|
|
{ include: '#labels' }
|
|
{ include: 'source.multi1' }
|
|
# { include: 'source.multi2' }
|
|
]
|
|
|
|
# Repository starts here ------------------------------------------------------
|
|
repository:
|
|
|
|
# Basic line format
|
|
line_processor:
|
|
patterns: [
|
|
]
|
|
|
|
# Labels
|
|
labels:
|
|
patterns: [
|
|
# Variables
|
|
{
|
|
match: '^][:-~][0-~]+'
|
|
name: 'entity.name.variable.6502-test'
|
|
}
|
|
# Local labels and variables
|
|
{
|
|
match: '^:[:-~][0-~]+'
|
|
# name: 'entity.name.label.function.6502-test'
|
|
name: 'entity.name.label.local.6502-test'
|
|
# name: 'constant.numeric.hex.6502-test'
|
|
}
|
|
# Global labels
|
|
{
|
|
match: '^[:-~][0-~]+'
|
|
name: 'entity.name.label.function.6502-test'
|
|
}
|
|
]
|
|
# Lines that start with an asterisk are comment lines
|
|
# commands within strings
|
|
# {
|
|
# begin: '"'
|
|
# end: '"'
|
|
# name: 'string.quoted.double'
|
|
# patterns: [
|
|
# { include: 'source.65c02-opcodes' }
|
|
# ]
|
|
# }
|
|
# # four line word
|
|
# {
|
|
# begin: '^(\\w*)\\s+\\b'
|
|
# beginCaptures:
|
|
# 1:
|
|
# name: 'invalid.illegal.6502-test'
|
|
# end: ';.*'
|
|
# endCaptures:
|
|
# 0:
|
|
# name: 'comment.line.semicolon.6502-test'
|
|
# name: 'constant.numeric.hex.6502-test'
|
|
# }
|
|
# four word line
|
|
# {
|
|
# # match: '^(\\w*)\\b\\s+(\\w*)\\b\\s+(\\w*)\\b\\s+(\\w*)\\b'
|
|
# match: '^(\\w*)\\s+(\\1)\\s+(\\1)\\b'
|
|
# captures:
|
|
# 1:
|
|
# name: 'invalid.illegal.6502-test'
|
|
# 2:
|
|
# name: 'keyword.mnemonic.6502-test'
|
|
# 3:
|
|
# name: 'constant.numeric.hex.6502-test'
|
|
# 4:
|
|
# name: 'comment.line.semicolon.6502-test'
|
|
# name: "meta.line_processor.6502-test"
|
|
# }
|
|
# ]
|
|
|
|
# comments
|
|
# comments:
|
|
# patterns: [
|
|
# # semicolon comments
|
|
# {
|
|
# match: ';.*$'
|
|
# name: 'comment.line.semicolon.6502-test'
|
|
# }
|
|
# ]
|
|
|
|
# symbols
|
|
# symbols:
|
|
# patterns: [
|
|
# {
|
|
# begin: '"'
|
|
# beginCaptures:
|
|
# 0:
|
|
# name: 'punctuation.definition.string.begin.6502-test'
|
|
# end: '"'
|
|
# endCaptures:
|
|
# 0:
|
|
# name: 'punctuation.definition.string.end.6502-test'
|
|
# name: 'string.quoted.double.assembly.6502-test'
|
|
# }
|
|
# # absolut address/number
|
|
# {
|
|
# match: '\\#(\'.\'|[^\\s\']+)'
|
|
# name: 'constant.numeric.hex.6502-test'
|
|
# }
|
|
# # hex, prefixed with ampersand($)
|
|
# {
|
|
# match: '-?\\$[A-Fa-f0-9]+'
|
|
# name: 'constant.numeric.hex.6502-test'
|
|
# }
|
|
# # hex, suffixed with h(h)
|
|
# {
|
|
# match: '-?([0-9]+)h'
|
|
# name: 'constant.numeric.hex.6502-test'
|
|
# }
|
|
# # binary
|
|
# {
|
|
# match: '%[01]+'
|
|
# name: 'constant.numeric.binary.6502-test'
|
|
# }
|
|
# # decimal
|
|
# {
|
|
# match: '\\b([0-9]+)\\b'
|
|
# name: 'constant.numeric.decimal.6502-test'
|
|
# }
|
|
# ]
|