From 28079336e1d492e4892867ea009bd6d8a6fb5c67 Mon Sep 17 00:00:00 2001 From: Georg Ziegler Date: Thu, 7 Jun 2018 17:15:47 +0200 Subject: [PATCH] Fix hex numbers with suffix 'h' --- grammars/65816-generic.cson | 2 +- grammars/65c02-generic.cson | 2 +- grammars/cc65-directives.cson | 9 +++++---- grammars/wdc-directives.cson | 14 +++++++------- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/grammars/65816-generic.cson b/grammars/65816-generic.cson index 4807f6c..9372062 100644 --- a/grammars/65816-generic.cson +++ b/grammars/65816-generic.cson @@ -49,7 +49,7 @@ repository: } # hex, suffixed with h(h) { - match: '-?([0-9]+)h' + match: '-?([a-fA-F0-9]+)h' name: 'constant.numeric.hex.65816-generic' } # binary diff --git a/grammars/65c02-generic.cson b/grammars/65c02-generic.cson index 4b007cc..ec8287b 100644 --- a/grammars/65c02-generic.cson +++ b/grammars/65c02-generic.cson @@ -49,7 +49,7 @@ repository: } # hex, suffixed with h(h) { - match: '-?([0-9]+)h' + match: '-?([a-fA-F0-9]+)h' name: 'constant.numeric.hex.65c02-generic' } # binary diff --git a/grammars/cc65-directives.cson b/grammars/cc65-directives.cson index 88b1e86..8941988 100644 --- a/grammars/cc65-directives.cson +++ b/grammars/cc65-directives.cson @@ -24,6 +24,7 @@ repository: # symbols symbols: patterns: [ + # strings { begin: '"' beginCaptures: @@ -35,19 +36,19 @@ repository: name: 'punctuation.definition.string.end.cc65-directives' name: 'string.quoted.double.assembly.cc65-directives' } - # absolut address/number + # absolut addressing/numbers { match: '\\#(\'.\'|[^\\s\']+)' name: 'constant.numeric.hex.cc65-directives' } - # hex, prefixed with ampersand($) + # hex, prefixed with dollar sign($) { - match: '-?\\$[A-Fa-f0-9]+' + match: '-?\\$[a-fA-F0-9]+' name: 'constant.numeric.hex.cc65-directives' } # hex, suffixed with h(h) { - match: '-?([0-9]+)h' + match: '-?\\b([a-fA-F0-9]+)h' name: 'constant.numeric.hex.cc65-directives' } # binary diff --git a/grammars/wdc-directives.cson b/grammars/wdc-directives.cson index f51e699..7df1014 100644 --- a/grammars/wdc-directives.cson +++ b/grammars/wdc-directives.cson @@ -36,19 +36,19 @@ repository: name: 'punctuation.definition.string.end.wdc-toolchain' name: 'string.quoted.double.assembly.wdc-toolchain' } - # absolut addressing/numbering + # absolut addressing/numbers { match: '\\#(\'.\'|[^\\s\']+)' name: 'constant.numeric.hex.wdc-toolchain' } - # hex, prefixed with ampersand($) + # hex, prefixed with dollar sign($) { - match: '-?\\$[A-Fa-f0-9]+' + match: '-?\\$\\b[a-fA-F0-9]+' name: 'constant.numeric.hex.wdc-toolchain' } # hex, suffixed with h(h) { - match: '-?([0-9]+)h' + match: '-?\\b([a-fA-F0-9]+)h' name: 'constant.numeric.hex.wdc-toolchain' } # binary prefixed with % @@ -63,7 +63,7 @@ repository: } # octal and decimal { - match: '\\b([0-9]+(d|o|q)?)\\b' + match: '\\b([0-9]+[doq]?)\\b' name: 'constant.numeric.decimal.wdc-toolchain' } ] @@ -73,7 +73,7 @@ repository: patterns: [ # File and Symbol control { - match: '\\b(?i:append|include|insert|end(s|mod)?|exit|module|section|org|origin|equ(al)?|gequ|defl|set|var|extern(al|s)?|xref|globals?|public|xdef|message|messg|efunc|incdebug)\\b' + match: '\\b(?i:append|include|insert|end(s|mod)?|exit|module|section|ref_only|org|origin|equ(al)?|gequ|defl|set|var|extern(al|s)?|xref|globals?|public|xdef|message|messg|efunc|incdebug)\\b' name: 'support.function.pseudo.wdc-toolchain' } # Parsing control @@ -108,7 +108,7 @@ repository: } # Operators II { - match: '\\b(?i:and|not|mod|sh[lr]|x?or|eq|u?[gl]t)\\b' + match: '\\.\\b(?i:and|not|mod|sh[lr]|x?or|eq|u?[gl]t)\\b\\.' name: 'keyword.operator.wdc-toolchain' } ]