From 0c0472862f5c1e543e6c5614a4cd112ac7d4cc13 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 14 Jul 2018 02:59:41 -0400 Subject: - New syntax for bit values: "#0" and "#1", instead of "false" and "true". - Small improvements to lux-mode. --- stdlib/source/lux/data/format/json.lux | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'stdlib/source/lux/data/format/json.lux') 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 [ ] [( x') ( 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 [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 )] (wrap )))] - [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) -- cgit v1.2.3