Modified regexp for symbols, fixed vim syntax highlighting.
h3rald h3rald@h3rald.com
Sat, 25 Mar 2017 14:21:26 +0100
2 files changed,
2 insertions(+),
2 deletions(-)
M
lib/min_lang.nim
→
lib/min_lang.nim
@@ -94,7 +94,7 @@ var symbol: string
if not q1.isQuotation: q1 = @[q1].newVal(i.scope) symbol = sym.getString - if not symbol.match "^[a-zA-Z0-9_][a-zA-Z0-9/!?+*._-]*$": + if not symbol.match "^[a-zA-Z_][a-zA-Z0-9/!?+*._-]*$": raiseInvalid("Symbol identifier '$1' contains invalid characters." % symbol) info "[define] $1 = $2" % [symbol, $q1] if i.scope.symbols.hasKey(symbol) and i.scope.symbols[symbol].sealed:
M
min.vim
→
min.vim
@@ -31,7 +31,7 @@ syntax region minSigilSymbol start=;\<[:@'~!$%&$=<>^*#+/]; end=;\>; contains=minDefaultSigil
syntax region minQuotedSymbol start=;\<[']; end=;\>; contains=minQuote syntax region minBoundSymbol start=;@; end=;\>; contains=minBinding syntax region minQuotedBoundSymbol start=;#; end=;\>; contains=minQuotedBinding -syntax match minSymbol ;[a-zA-Z0-9+._-][a-zA-Z0-9/!?+*._-]*; +syntax match minSymbol ;[a-zA-Z._][a-zA-Z0-9/!?+*._-]*; syntax match minParen ;(\|);