diff options
Diffstat (limited to '')
-rw-r--r-- | lux-mode/lux-mode.el | 12 | ||||
-rw-r--r-- | luxc/src/lux/lexer.clj | 8 |
2 files changed, 9 insertions, 11 deletions
diff --git a/lux-mode/lux-mode.el b/lux-mode/lux-mode.el index 5beb7f91c..45db10635 100644 --- a/lux-mode/lux-mode.el +++ b/lux-mode/lux-mode.el @@ -254,14 +254,14 @@ Called by `imenu--generic-function'." "\\>") 0 font-lock-constant-face) ; Nat literals - ("\\<\\+\\(0\\|[1-9][0-9_]*\\)\\>" 0 font-lock-constant-face) + ("\\<\\+\\(0\\|[0-9][0-9_]*\\)\\>" 0 font-lock-constant-face) ; Int|Frac literals - ("\\<-?\\(0\\|[1-9][0-9_]*\\)\\(\\.[0-9_]+\\)?\\>" 0 font-lock-constant-face) - ("\\<-?\\(0\\|[1-9][0-9_]*\\)\\(\\.[0-9_]+\\(\\(e\\|E\\)\\(-\\|\\+\\)?[1-9][0-9_]*\\)?\\)?\\>" 0 font-lock-constant-face) + ("\\<-?\\(0\\|[0-9][0-9_]*\\)\\(\\.[0-9_]+\\)?\\>" 0 font-lock-constant-face) + ("\\<-?\\(0\\|[--9][0-9_]*\\)\\(\\.[0-9_]+\\(\\(e\\|E\\)\\(-\\|\\+\\)?[0-9][0-9_]*\\)?\\)?\\>" 0 font-lock-constant-face) ; Frac "ratio" literals - ("\\<-?\\(0\\|[1-9][0-9_]*\\)/[1-9][0-9_]*\\>" 0 font-lock-constant-face) + ("\\<-?\\(0\\|[0-9][0-9_]*\\)/[0-9][0-9_]*\\>" 0 font-lock-constant-face) ; Deg literals - ("\\<\\(\\.[0-9_]+\\)\\>" 0 font-lock-constant-face) + ("\\<\\(\\.[0-9][0-9_]*\\)\\>" 0 font-lock-constant-face) ; Tags ("#\\.[a-zA-Z0-9-\\+_=!@\\$%\\^&\\*<>\.,/\\\\\\|':~\\?]+" 0 font-lock-type-face) ("#\\.\\.[a-zA-Z0-9-\\+_=!@\\$%\\^&\\*<>\.,/\\\\\\|':~\\?]+" 0 font-lock-type-face) @@ -396,6 +396,4 @@ This function also returns nil meaning don't specify the indentation." ) ;;;###autoload - - (provide 'lux-mode) diff --git a/luxc/src/lux/lexer.clj b/luxc/src/lux/lexer.clj index 7bd329766..84c925cbc 100644 --- a/luxc/src/lux/lexer.clj +++ b/luxc/src/lux/lexer.clj @@ -138,10 +138,10 @@ (|do [[meta _ token] (&reader/read-regex <regex>)] (return (&/T [meta (<tag> (string/replace token #"_" ""))])))) - lex-nat $Nat #"^\+(0|[1-9][0-9_]*)" - lex-int $Int #"^-?(0|[1-9][0-9_]*)" - lex-deg $Deg #"^(\.[0-9_]+)" - lex-frac $Frac #"^-?(0\.[0-9_]+|[1-9][0-9_]*\.[0-9_]+)(e-?[1-9][0-9_]*)?" + lex-nat $Nat #"^\+[0-9][0-9_]*" + lex-int $Int #"^-?[0-9][0-9_]*" + lex-deg $Deg #"^\.[0-9][0-9_]+" + lex-frac $Frac #"^-?[0-9][0-9_]*\.[0-9_]+((e|E)(-|\+)?[0-9][0-9_]*)?" ) (def +same-module-mark+ (str &/+name-separator+ &/+name-separator+)) |