aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/data/format/json.lux
diff options
context:
space:
mode:
authorEduardo Julian2018-08-22 22:50:33 -0400
committerEduardo Julian2018-08-22 22:50:33 -0400
commit5e13ae0ad68947249a98dc69ab513bdbeca1697e (patch)
tree96f96c209979c095e48bb17f24e3e168385438cc /stdlib/source/lux/data/format/json.lux
parentd2efa1fd37efa50a460dfa609ddd274d82d082e3 (diff)
No more escaping of horizontal-tab.
Diffstat (limited to 'stdlib/source/lux/data/format/json.lux')
-rw-r--r--stdlib/source/lux/data/format/json.lux21
1 files changed, 14 insertions, 7 deletions
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)