From 0466fe17919edffb9f08e7c3af9e5f3124232ced Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sat, 22 Jul 2023 16:19:10 -0400 Subject: [PATCH] update syntax --- Syntaxes/SNASM.sublime-syntax | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/Syntaxes/SNASM.sublime-syntax b/Syntaxes/SNASM.sublime-syntax index 1c2e64a..38f32da 100644 --- a/Syntaxes/SNASM.sublime-syntax +++ b/Syntaxes/SNASM.sublime-syntax @@ -3,9 +3,11 @@ name: SN Assembler scope: source.asm.65816.sn +# @ is the default local prefix, but /opt l can change it. : was common. variables: 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}}' push: opcode - - match: '^({{ident}}){{ws}}((?i)SECTION)\b' + - match: '^({{ident}}){{ws}}((?i)MODULE)\b' captures: 1: entity.name.function 2: keyword.directive @@ -35,7 +37,11 @@ contexts: - match: '^{{ident}}' - scope: entity.name.label + scope: entity.name.function + + - match: '^{{local}}' + scope: entity.name.label.local + - include: comment @@ -114,7 +120,7 @@ contexts: scope: keyword.directive.keyword.control set: operand - - match: \b(?i:IF|ELSE|ENDIF)\b + - match: \b(?i:IF|ELSE|ENDIF|ENDC)\b scope: keyword.directive.keyword.control set: operand @@ -132,6 +138,11 @@ contexts: scope: keyword.directive set: operand + - match: \b(?i:INCLUDE|INCBIN)\b + scope: keyword.directive + set: operand-path + + operand: - include: numbers - include: strings @@ -163,9 +174,6 @@ contexts: - include: expect-comment - operand-import: - - match: ([^; \n\t]+) - scope: string.unquoted operand-ascii: - meta_include_prototype: false @@ -189,6 +197,8 @@ contexts: scope: invalid.illegal pop: true + operand-path: + - include: strings operand-macro: - match: '\b{{ident}}\b' @@ -263,7 +273,7 @@ contexts: 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