diff options
author | Eduardo Julian | 2020-10-25 05:10:08 -0400 |
---|---|---|
committer | Eduardo Julian | 2020-10-25 05:10:08 -0400 |
commit | 72b4eecdc514387ab3b1c105cfd49436c9eb1e8d (patch) | |
tree | 20d8e52d5769b00be003dea58754b5bea79bb9e3 /stdlib/source/lux/data/format/json.lux | |
parent | e153b011bb94ba95474505c307873616bb493b6d (diff) |
Some improvements to the Lux syntax parser.
Diffstat (limited to 'stdlib/source/lux/data/format/json.lux')
-rw-r--r-- | stdlib/source/lux/data/format/json.lux | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/stdlib/source/lux/data/format/json.lux b/stdlib/source/lux/data/format/json.lux index e9b6ab8b6..643d12969 100644 --- a/stdlib/source/lux/data/format/json.lux +++ b/stdlib/source/lux/data/format/json.lux @@ -81,8 +81,8 @@ (wrap (list (` (: JSON (#..Array ((~! row) (~+ (list@map wrapper members)))))))) [_ (#.Record pairs)] - (do {@ ..monad} - [pairs' (monad.map @ + (do {! ..monad} + [pairs' (monad.map ! (function (_ [slot value]) (case slot [_ (#.Text key-name)] @@ -282,15 +282,15 @@ (def: number~ (Parser Number) - (do {@ <>.monad} + (do {! <>.monad} [signed? (<>.parses? (<t>.this "-")) digits (<t>.many <t>.decimal) decimals (<>.default "0" - (do @ + (do ! [_ (<t>.this ".")] (<t>.many <t>.decimal))) exp (<>.default "" - (do @ + (do ! [mark (<t>.one-of "eE") signed?' (<>.parses? (<t>.this "-")) offset (<t>.many <t>.decimal)] @@ -324,11 +324,11 @@ (Parser String) (<| (<t>.enclosed [text.double-quote text.double-quote]) (loop [_ []]) - (do {@ <>.monad} + (do {! <>.monad} [chars (<t>.some (<t>.none-of (text@compose "\" text.double-quote))) stop <t>.peek]) (if (text@= "\" stop) - (do @ + (do ! [escaped escaped~ next-chars (recur [])] (wrap ($_ text@compose chars escaped next-chars))) |