diff options
author | Eduardo Julian | 2018-07-14 02:59:41 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-07-14 02:59:41 -0400 |
commit | 0c0472862f5c1e543e6c5614a4cd112ac7d4cc13 (patch) | |
tree | a94c7cd4bf3c916296c5341c5fc043ca71acb184 /stdlib/source/lux/data/format/json.lux | |
parent | 69fefab57c40f323d759dc444dbcebad15071585 (diff) |
- New syntax for bit values: "#0" and "#1", instead of "false" and "true".
- Small improvements to lux-mode.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/data/format/json.lux | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/stdlib/source/lux/data/format/json.lux b/stdlib/source/lux/data/format/json.lux index 4dfa6cb7d..261ff1330 100644 --- a/stdlib/source/lux/data/format/json.lux +++ b/stdlib/source/lux/data/format/json.lux @@ -54,7 +54,7 @@ (syntax: #export (json token) {#.doc (doc "A simple way to produce JSON literals." - (json true) + (json #1) (json 123.456) (json "Some text") (json #null) @@ -154,7 +154,7 @@ (def: (= x y) (case [x y] [#Null #Null] - true + #1 (^template [<tag> <struct>] [(<tag> x') (<tag> y')] @@ -167,12 +167,12 @@ (and (n/= (row.size xs) (row.size ys)) (list/fold (function (_ idx prev) (and prev - (maybe.default false + (maybe.default #0 (do maybe.Monad<Maybe> [x' (row.nth idx xs) y' (row.nth idx ys)] (wrap (= x' y')))))) - true + #1 (list.indices (row.size xs)))) [(#Object xs) (#Object ys)] @@ -180,13 +180,13 @@ (list/fold (function (_ [xk xv] prev) (and prev (case (dict.get xk ys) - #.None false + #.None #0 (#.Some yv) (= xv yv)))) - true + #1 (dict.entries xs))) _ - false))) + #0))) ############################################################ ############################################################ @@ -420,13 +420,13 @@ [_ (l.this <token>)] (wrap <value>)))] - [t~ "true" true] - [f~ "false" false] + [true~ "true" #1] + [false~ "false" #0] ) (def: boolean~ (l.Lexer Boolean) - (p.either t~ f~)) + (p.either true~ false~)) (def: number~ (l.Lexer Number) |