From 72b4eecdc514387ab3b1c105cfd49436c9eb1e8d Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 25 Oct 2020 05:10:08 -0400 Subject: Some improvements to the Lux syntax parser. --- stdlib/source/lux/data/format/json.lux | 14 +++++++------- 1 file changed, 7 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 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? (.this "-")) digits (.many .decimal) decimals (<>.default "0" - (do @ + (do ! [_ (.this ".")] (.many .decimal))) exp (<>.default "" - (do @ + (do ! [mark (.one-of "eE") signed?' (<>.parses? (.this "-")) offset (.many .decimal)] @@ -324,11 +324,11 @@ (Parser String) (<| (.enclosed [text.double-quote text.double-quote]) (loop [_ []]) - (do {@ <>.monad} + (do {! <>.monad} [chars (.some (.none-of (text@compose "\" text.double-quote))) stop .peek]) (if (text@= "\" stop) - (do @ + (do ! [escaped escaped~ next-chars (recur [])] (wrap ($_ text@compose chars escaped next-chars))) -- cgit v1.2.3