2018-05-28 01:51:19 +00:00
|
|
|
# Syntax Highlighting for the acme directives
|
|
|
|
|
|
|
|
scopeName: 'source.assembly.6502.acme'
|
|
|
|
name: 'ACME Crossassembler'
|
|
|
|
filetypes: [
|
|
|
|
'a'
|
|
|
|
'asm'
|
|
|
|
]
|
|
|
|
|
|
|
|
patterns: [
|
|
|
|
{ include: 'source.6502-opcodes' }
|
|
|
|
{ include: 'source.6502x-opcodes' }
|
|
|
|
{ include: '#comments' }
|
|
|
|
# symbols, constants, numbers
|
|
|
|
{ include: '#symbols' }
|
|
|
|
# directives
|
|
|
|
{ include: '#directives' }
|
|
|
|
]
|
|
|
|
|
|
|
|
# Repository starts here ------------------------------------------------------
|
|
|
|
|
|
|
|
repository:
|
|
|
|
# comments
|
|
|
|
comments:
|
|
|
|
patterns: [
|
|
|
|
# semicolon comments
|
|
|
|
{
|
|
|
|
match: ';.*$'
|
|
|
|
name: 'comment.line.semicolon.acme'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
|
|
|
# symbols
|
|
|
|
symbols:
|
|
|
|
patterns: [
|
|
|
|
# strings
|
|
|
|
{
|
|
|
|
begin: '"'
|
|
|
|
beginCaptures:
|
|
|
|
0:
|
|
|
|
name: 'punctuation.definition.string.begin.acme'
|
|
|
|
end: '"'
|
|
|
|
endCaptures:
|
|
|
|
0:
|
|
|
|
name: 'punctuation.definition.string.end.acme'
|
2018-06-07 16:24:53 +00:00
|
|
|
name: 'string.quoted.double.acme'
|
2018-05-28 01:51:19 +00:00
|
|
|
}
|
|
|
|
# absolut addressing/numbering
|
|
|
|
{
|
|
|
|
match: '\\#(\'.\'|[^\\s\']+)'
|
|
|
|
name: 'constant.numeric.hex.acme'
|
|
|
|
}
|
|
|
|
# hex, prefixed with dollar ($)
|
|
|
|
{
|
|
|
|
match: '-?\\$[A-Fa-f0-9]+'
|
|
|
|
name: 'constant.numeric.hex.acme'
|
|
|
|
}
|
|
|
|
# binary prefixed with %
|
|
|
|
{
|
|
|
|
match: '%[01]+'
|
|
|
|
name: 'constant.numeric.binary.acme'
|
|
|
|
}
|
|
|
|
# decimal
|
|
|
|
{
|
|
|
|
match: '\\b([0-9]+)\\b'
|
|
|
|
name: 'constant.numeric.decimal.acme'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
|
|
|
# assembler directives
|
|
|
|
directives:
|
|
|
|
patterns: [
|
|
|
|
# File and Symbol control
|
|
|
|
{
|
2018-06-03 00:58:07 +00:00
|
|
|
match: '!\\b(?i:source|src|eof|endoffile|realpc|pseudopc|zn|(sub)?zone|set|to|bin(ary)?|sl|symbollist|warn|error|serious|initmem|cbm|addr(ess)?)\\b'
|
2018-05-28 01:51:19 +00:00
|
|
|
name: 'support.function.pseudo.acme'
|
|
|
|
}
|
|
|
|
# Parsing control
|
|
|
|
{
|
2018-06-03 00:58:07 +00:00
|
|
|
match: '!\\b(?i:cpu|al|as|rl|rs|08|by|byte|([bl]e)?(16|24|32)|wo|word|h|hex|fi|fill|align|skip|ct|convtab|tx|text|pet|scr|scrxor|raw)\\b'
|
2018-05-28 01:51:19 +00:00
|
|
|
name: 'support.function.pseudo.acme'
|
|
|
|
}
|
|
|
|
# Macro control
|
|
|
|
{
|
2018-06-03 00:58:07 +00:00
|
|
|
match: '(?i:!\\bmacro|\\+[a-zA-Z0-9])\\b'
|
2018-05-28 01:51:19 +00:00
|
|
|
name: 'support.function.pseudo.acme'
|
|
|
|
}
|
|
|
|
# Conditional control
|
|
|
|
{
|
2018-06-03 00:58:07 +00:00
|
|
|
match: '!\\b(?i:if|if(n)?def|for|do|while|until)\\b'
|
|
|
|
name: 'keyword.control.conditional.acme'
|
|
|
|
}
|
|
|
|
# Conditional control II
|
|
|
|
{
|
|
|
|
match: '\\b(?i:else|while|until)\\b'
|
2018-05-28 01:51:19 +00:00
|
|
|
name: 'keyword.control.conditional.acme'
|
|
|
|
}
|
|
|
|
# Operators
|
|
|
|
{
|
|
|
|
match: '!|\\+|\\-|\\/|\\*|<<|>>|&|\\||\\^|=|<|>|\\:|\\|\\|'
|
|
|
|
name: 'keyword.operator.acme'
|
|
|
|
}
|
|
|
|
# Operators II
|
|
|
|
{
|
|
|
|
match: '\\b(?i:and|not|mod|sh[lr]|x?or|eq|u?[gl]t)\\b'
|
|
|
|
name: 'keyword.operator.acme'
|
|
|
|
}
|
|
|
|
]
|