aboutsummaryrefslogtreecommitdiff
path: root/luxc/src
diff options
context:
space:
mode:
Diffstat (limited to 'luxc/src')
-rw-r--r--luxc/src/lux/lexer.clj7
-rw-r--r--luxc/src/lux/parser.clj2
2 files changed, 5 insertions, 4 deletions
diff --git a/luxc/src/lux/lexer.clj b/luxc/src/lux/lexer.clj
index 354bf98e2..73bcb4f22 100644
--- a/luxc/src/lux/lexer.clj
+++ b/luxc/src/lux/lexer.clj
@@ -130,7 +130,7 @@
(|do [[meta _ token] (&reader/read-regex <regex>)]
(return (&/T [meta (<tag> token)]))))
- lex-bit $Bit #"^(#0|#1)"
+ lex-bit $Bit #"^#(0|1)"
)
(do-template [<name> <tag> <regex>]
@@ -138,10 +138,11 @@
(|do [[meta _ token] (&reader/read-regex <regex>)]
(return (&/T [meta (<tag> (string/replace token #"_" ""))]))))
- lex-nat $Nat #"^\+[0-9][0-9_]*"
+ ;; (-|\+)
+ lex-nat $Nat #"^\|[0-9][0-9_]*"
lex-int $Int #"^-?[0-9][0-9_]*"
lex-rev $Rev #"^\.[0-9][0-9_]*"
- lex-frac $Frac #"^-?[0-9][0-9_]*\.[0-9_]+((e|E)(-|\+)?[0-9][0-9_]*)?"
+ lex-frac $Frac #"^-?[0-9][0-9_]*\.[0-9][0-9_]*((e|E)(-|\+)[0-9][0-9_]*)?"
)
(def +same-module-mark+ (str &/+name-separator+ &/+name-separator+))
diff --git a/luxc/src/lux/parser.clj b/luxc/src/lux/parser.clj
index dd33129b8..5303327c8 100644
--- a/luxc/src/lux/parser.clj
+++ b/luxc/src/lux/parser.clj
@@ -68,7 +68,7 @@
(return (&/|list (&/T [meta (&/$Bit (.equals ^String ?value "#1"))])))
(&lexer/$Nat ?value)
- (return (&/|list (&/T [meta (&/$Nat (Long/parseUnsignedLong ?value))])))
+ (return (&/|list (&/T [meta (&/$Nat (Long/parseUnsignedLong (.substring ^String ?value 1)))])))
(&lexer/$Int ?value)
(return (&/|list (&/T [meta (&/$Int (Long/parseLong ?value))])))