diff options
author | Eduardo Julian | 2017-07-01 17:36:17 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-07-01 17:36:17 -0400 |
commit | c6a107d54f20a57dff4b8e26b07d8eac15982c91 (patch) | |
tree | 380d8ddd694acd0c57e5ad7be2d27e4b5f061b93 /stdlib/source/lux/data/format/json.lux | |
parent | a2f8078dcc79d7f4aa0f596b08f4402546df5ddb (diff) |
- Lexers now carry an offset which they use to figure out where to extract parts of the whole input, instead of having to clip the input as they lex. thereby doing a lot of unnecessary text allocations.
- Some refactoring.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/data/format/json.lux | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/stdlib/source/lux/data/format/json.lux b/stdlib/source/lux/data/format/json.lux index 0ce1b602a..d7469e24b 100644 --- a/stdlib/source/lux/data/format/json.lux +++ b/stdlib/source/lux/data/format/json.lux @@ -260,16 +260,16 @@ (l;Lexer Number) (do p;Monad<Parser> [signed? (l;this? "-") - digits (l;many l;digit) + digits (l;many l;decimal) decimals (p;default "0" (do @ [_ (l;this ".")] - (l;many l;digit))) + (l;many l;decimal))) exp (p;default "" (do @ [mark (l;one-of "eE") signed?' (l;this? "-") - offset (l;many l;digit)] + offset (l;many l;decimal)] (wrap (format mark (if signed?' "-" "") offset))))] (case (Real/decode (format (if signed? "-" "") digits "." decimals exp)) (#R;Error message) |