From b60d60ef6c0c70821991991fe716935e73038832 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 22 Aug 2018 19:42:17 -0400 Subject: No more multi-line text. --- stdlib/source/lux/data/format/json.lux | 5 ++--- 1 file changed, 2 insertions(+), 3 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 3594ef28c..c26df1893 100644 --- a/stdlib/source/lux/data/format/json.lux +++ b/stdlib/source/lux/data/format/json.lux @@ -1,6 +1,5 @@ -(.module: {#.doc "Functionality for reading and writing values in the JSON format. - - For more information, please see: http://www.json.org/"} +(.module: {#.doc (.doc "Functionality for reading and writing values in the JSON format." + "For more information, please see: http://www.json.org/")} [lux #* [control ["." monad (#+ do Monad)] -- cgit v1.2.3 From 5e13ae0ad68947249a98dc69ab513bdbeca1697e Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 22 Aug 2018 22:50:33 -0400 Subject: No more escaping of horizontal-tab. --- stdlib/source/lux/data/format/json.lux | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 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 c26df1893..1d0837b90 100644 --- a/stdlib/source/lux/data/format/json.lux +++ b/stdlib/source/lux/data/format/json.lux @@ -452,13 +452,20 @@ (def: escaped~ (l.Lexer Text) ($_ p.either - (p.after (l.this "\\t") (parser/wrap "\t")) - (p.after (l.this "\\b") (parser/wrap "\b")) - (p.after (l.this "\\n") (parser/wrap "\n")) - (p.after (l.this "\\r") (parser/wrap "\r")) - (p.after (l.this "\\f") (parser/wrap "\f")) - (p.after (l.this "\\\"") (parser/wrap "\"")) - (p.after (l.this "\\\\") (parser/wrap "\\")))) + (p.after (l.this "\\t") + (parser/wrap text.tab)) + (p.after (l.this "\\b") + (parser/wrap text.back-space)) + (p.after (l.this "\\n") + (parser/wrap text.new-line)) + (p.after (l.this "\\r") + (parser/wrap text.carriage-return)) + (p.after (l.this "\\f") + (parser/wrap text.form-feed)) + (p.after (l.this (text/compose "\\" text.double-quote)) + (parser/wrap text.double-quote)) + (p.after (l.this "\\\\") + (parser/wrap "\\")))) (def: string~ (l.Lexer String) -- cgit v1.2.3 From a89088576c4e586d3dad18f82eb451ff4eaa14fb Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 23 Aug 2018 00:03:26 -0400 Subject: No more escaping of double-quotes. --- stdlib/source/lux/data/format/json.lux | 12 ++++++------ 1 file changed, 6 insertions(+), 6 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 1d0837b90..9189b375f 100644 --- a/stdlib/source/lux/data/format/json.lux +++ b/stdlib/source/lux/data/format/json.lux @@ -113,10 +113,10 @@ (#e.Success value) #.None - (#e.Error ($_ text/compose "Missing field \"" key "\" on object."))) + (#e.Error ($_ text/compose "Missing field '" key "' on object."))) _ - (#e.Error ($_ text/compose "Cannot get field \"" key "\" of a non-object.")))) + (#e.Error ($_ text/compose "Cannot get field '" key "' of a non-object.")))) (def: #export (set key value json) {#.doc "A JSON object field setter."} @@ -126,7 +126,7 @@ (#e.Success (#Object (dict.put key value obj))) _ - (#e.Error ($_ text/compose "Cannot set field \"" key "\" of a non-object.")))) + (#e.Error ($_ text/compose "Cannot set field '" key "' of a non-object.")))) (do-template [ ] [(def: #export ( key json) @@ -352,7 +352,7 @@ (fail error)) _ - (fail ($_ text/compose "JSON object does not have field \"" field-name "\"."))) + (fail ($_ text/compose "JSON object does not have field '" field-name "'."))) _ (fail "JSON value is not an object.")))) @@ -469,10 +469,10 @@ (def: string~ (l.Lexer String) - (<| (l.enclosed ["\"" "\""]) + (<| (l.enclosed [text.double-quote text.double-quote]) (loop [_ []]) (do p.Monad - [chars (l.some (l.none-of "\\\"")) + [chars (l.some (l.none-of (text/compose "\\" text.double-quote))) stop l.peek]) (if (text/= "\\" stop) (do @ -- cgit v1.2.3 From 7e312258b13c5fc9c80079fede0e41d479a8a327 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 23 Aug 2018 01:24:29 -0400 Subject: No more escaping of back-slash. --- 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 9189b375f..20f059503 100644 --- a/stdlib/source/lux/data/format/json.lux +++ b/stdlib/source/lux/data/format/json.lux @@ -452,29 +452,29 @@ (def: escaped~ (l.Lexer Text) ($_ p.either - (p.after (l.this "\\t") + (p.after (l.this "\t") (parser/wrap text.tab)) - (p.after (l.this "\\b") + (p.after (l.this "\b") (parser/wrap text.back-space)) - (p.after (l.this "\\n") + (p.after (l.this "\n") (parser/wrap text.new-line)) - (p.after (l.this "\\r") + (p.after (l.this "\r") (parser/wrap text.carriage-return)) - (p.after (l.this "\\f") + (p.after (l.this "\f") (parser/wrap text.form-feed)) - (p.after (l.this (text/compose "\\" text.double-quote)) + (p.after (l.this (text/compose "\" text.double-quote)) (parser/wrap text.double-quote)) - (p.after (l.this "\\\\") - (parser/wrap "\\")))) + (p.after (l.this "\\") + (parser/wrap "\")))) (def: string~ (l.Lexer String) (<| (l.enclosed [text.double-quote text.double-quote]) (loop [_ []]) (do p.Monad - [chars (l.some (l.none-of (text/compose "\\" text.double-quote))) + [chars (l.some (l.none-of (text/compose "\" text.double-quote))) stop l.peek]) - (if (text/= "\\" stop) + (if (text/= "\" stop) (do @ [escaped escaped~ next-chars (recur [])] -- cgit v1.2.3