update syntax

This commit is contained in:
Kelvin Sherlock 2023-07-22 16:19:10 -04:00
parent e87d04edcc
commit 0466fe1791

View File

@ -3,9 +3,11 @@
name: SN Assembler name: SN Assembler
scope: source.asm.65816.sn scope: source.asm.65816.sn
# @ is the default local prefix, but /opt l can change it. : was common.
variables: variables:
ws: '[ \t]+' ws: '[ \t]+'
ident: '[A-Za-z_~][A-Za-z0-9_~]*' ident: '[A-Za-z_.][A-Za-z0-9_.]*'
local: '[@:][A-Za-z0-9_.]+'
@ -20,7 +22,7 @@ contexts:
- match: '{{ws}}' - match: '{{ws}}'
push: opcode push: opcode
- match: '^({{ident}}){{ws}}((?i)SECTION)\b' - match: '^({{ident}}){{ws}}((?i)MODULE)\b'
captures: captures:
1: entity.name.function 1: entity.name.function
2: keyword.directive 2: keyword.directive
@ -35,7 +37,11 @@ contexts:
- match: '^{{ident}}' - match: '^{{ident}}'
scope: entity.name.label scope: entity.name.function
- match: '^{{local}}'
scope: entity.name.label.local
- include: comment - include: comment
@ -114,7 +120,7 @@ contexts:
scope: keyword.directive.keyword.control scope: keyword.directive.keyword.control
set: operand set: operand
- match: \b(?i:IF|ELSE|ENDIF)\b - match: \b(?i:IF|ELSE|ENDIF|ENDC)\b
scope: keyword.directive.keyword.control scope: keyword.directive.keyword.control
set: operand set: operand
@ -132,6 +138,11 @@ contexts:
scope: keyword.directive scope: keyword.directive
set: operand set: operand
- match: \b(?i:INCLUDE|INCBIN)\b
scope: keyword.directive
set: operand-path
operand: operand:
- include: numbers - include: numbers
- include: strings - include: strings
@ -163,9 +174,6 @@ contexts:
- include: expect-comment - include: expect-comment
operand-import:
- match: ([^; \n\t]+)
scope: string.unquoted
operand-ascii: operand-ascii:
- meta_include_prototype: false - meta_include_prototype: false
@ -189,6 +197,8 @@ contexts:
scope: invalid.illegal scope: invalid.illegal
pop: true pop: true
operand-path:
- include: strings
operand-macro: operand-macro:
- match: '\b{{ident}}\b' - match: '\b{{ident}}\b'
@ -263,7 +273,7 @@ contexts:
mnemonics-65816-alt: mnemonics-65816-alt:
- match: \b(?i:BLT|BGE|CPA|DEA|INA|RET|SWA|TAD|TAS|TDA|TSA|XOR)\b - match: \b(?i:BLT|BGE|CPA|DEA|INA|SWA|TAD|TAS|TDA|TSA)\b
scope: keyword.mnemonic.65816.alt scope: keyword.mnemonic.65816.alt