From 28379552af830f7c1018580f848ce1ef8c09ef3d Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sun, 17 Sep 2017 00:26:33 -0400 Subject: [PATCH] clean up orca some more. --- Syntaxes/ORCA-M.sublime-syntax | 42 ++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/Syntaxes/ORCA-M.sublime-syntax b/Syntaxes/ORCA-M.sublime-syntax index 17bad9e..b409734 100644 --- a/Syntaxes/ORCA-M.sublime-syntax +++ b/Syntaxes/ORCA-M.sublime-syntax @@ -10,33 +10,44 @@ variables: contexts: + prototype: + - include: comment + - include: eol + main: - meta_include_prototype: false - match: '{{ws}}' - set: opcode + push: opcode - match: '^({{ident}}){{ws}}((?i)START|PRIVATE|DATA|PRIVDATA)\b' captures: 1: entity.name.function 2: keyword.directive - set: operand-segname + push: operand-segname - match: '^{{ident}}' scope: entity.name.label - - match: ^[*;!.].*$ - scope: comment.line + - match: ^[*;!.] + push: + - meta_scope: comment.line + - match: \n + pop: true opcode: - - include: comment - - include: scope:source.asm.65816#mnemonics-6502 - include: scope:source.asm.65816#mnemonics-65c02 - include: scope:source.asm.65816#mnemonics-65816 - include: mnemonics-65816-alt + # toolbox macros + - match: \b_[A-Za-z0-9]+\b + scope: support.function.macro.toolbox + - match: ~[A-Za-z0-9]+\b + scope: support.function.macro.toolbox + - match: \b(?i:DC)\b scope: keyword.directive set: operand-dc @@ -86,7 +97,6 @@ contexts: set: operand operand: - - include: comment - include: numbers - include: strings @@ -103,8 +113,6 @@ contexts: scope: invalid.illegal.operand operand-or-off: - - include: comment - - match: \b(?i:OFF)\b scope: constant.language set: expect-comment @@ -137,7 +145,6 @@ contexts: operand-on-off: - - include: comment - match: \b(?i:ON|OFF)\b scope: constant.language set: expect-comment @@ -161,8 +168,6 @@ contexts: operand-dc-format: - - include: comment - - match: ([bB]) scope: storage.type set: operand-dc-b @@ -261,10 +266,17 @@ contexts: comment: - - match: ;[^\n]* - scope: comment.line.partial + - match: ; + push: + - meta_scope: comment.line + - match: \n + pop: true + - include: eol + + eol: - match: '$' - set: main + pop: true + numbers: - match: \d+