From 10585b8c0a5b89222da8e0e3060d21a60497e8cf Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Mon, 25 Mar 2013 22:30:27 -0400 Subject: [PATCH] move common code to base --- Syntaxes/65816.tmLanguage | 31 +++++++++++ Syntaxes/NinjaForce assembler.tmLanguage | 67 +++++++++++++++++------- 2 files changed, 79 insertions(+), 19 deletions(-) diff --git a/Syntaxes/65816.tmLanguage b/Syntaxes/65816.tmLanguage index dd4d5d0..ec84123 100644 --- a/Syntaxes/65816.tmLanguage +++ b/Syntaxes/65816.tmLanguage @@ -15,6 +15,37 @@ keyword.mnemonic.65816 + repository + + binary_number + + match + %[01]+ + name + constant.numeric.binary + + decimal_number + + match + \b([0-9]+)\b + name + constant.numeric.decimal + + hex_number + + match + \$[A-Za-z0-9]+ + name + constant.numeric.hex + + long_mnemonics + + match + \b(?i:ADCL|ANDL|CMPL|EORL|LDAL|ORAL|SBCL|STAL)\b + name + keyword.mnemonic.65816.long + + scopeName source.asm.65816 uuid diff --git a/Syntaxes/NinjaForce assembler.tmLanguage b/Syntaxes/NinjaForce assembler.tmLanguage index f8b2dcf..15fc25c 100644 --- a/Syntaxes/NinjaForce assembler.tmLanguage +++ b/Syntaxes/NinjaForce assembler.tmLanguage @@ -14,9 +14,25 @@ include source.asm.65816 + + include + source.asm.65816#long_mnemonics + + + include + source.asm.65816#hex_number + + + include + source.asm.65816#binary_number + + + include + source.asm.65816#decimal_number + match - \b(?i:BLT|BGT|BGE)\b + \b(?i:BLT|BGE)\b name keyword.mnemonic.65816.alt @@ -71,6 +87,37 @@ + + begin + \b((?i)HEX)\b + captures + + 1 + + name + keyword.directive + + + comment + HEX has a list of hex bytes w/o the $ + end + $|; + name + meta.hex + patterns + + + match + \b[0-9A-Fa-f]{1,2}\b + name + constant.numeric.hex + + + include + $self + + + match (?<=,)([xXyYsS])\b @@ -95,24 +142,6 @@ name comment.line - - match - \$[A-Za-z0-9]+ - name - constant.numeric.hex - - - match - %[01]+ - name - constant.numeric.binary - - - match - \b[0-9]+\b - name - constant.numeric.decimal - match [-+/*^><|#\[\](),=]