From 2431e767a09894c2f685911ba7f1ba0b7de2a165 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 13 Jul 2021 02:41:45 -0400 Subject: Improved the XML parsing library. --- stdlib/source/program/aedifex/artifact/snapshot/build.lux | 8 +++----- stdlib/source/program/aedifex/artifact/snapshot/stamp.lux | 7 +++---- stdlib/source/program/aedifex/artifact/snapshot/version.lux | 11 +++-------- 3 files changed, 9 insertions(+), 17 deletions(-) (limited to 'stdlib/source/program/aedifex/artifact/snapshot') diff --git a/stdlib/source/program/aedifex/artifact/snapshot/build.lux b/stdlib/source/program/aedifex/artifact/snapshot/build.lux index d9a8b729e..cd87c283e 100644 --- a/stdlib/source/program/aedifex/artifact/snapshot/build.lux +++ b/stdlib/source/program/aedifex/artifact/snapshot/build.lux @@ -36,8 +36,6 @@ (def: #export parser (Parser Build) - (do <>.monad - [_ (.node ..tag)] - (.embed (<>.codec nat.decimal - (.many .decimal)) - (.children .text)))) + (<| (.node ..tag) + (.embed (<>.codec nat.decimal (.many .decimal))) + .text)) diff --git a/stdlib/source/program/aedifex/artifact/snapshot/stamp.lux b/stdlib/source/program/aedifex/artifact/snapshot/stamp.lux index f321e11c1..2d127af21 100644 --- a/stdlib/source/program/aedifex/artifact/snapshot/stamp.lux +++ b/stdlib/source/program/aedifex/artifact/snapshot/stamp.lux @@ -44,10 +44,9 @@ (def: time_parser (Parser Time) - (do <>.monad - [_ (.node )] - (.embed //time.parser - (.children .text)))) + (<| (.node ) + (.embed //time.parser) + .text)) (def: #export parser (Parser Stamp) diff --git a/stdlib/source/program/aedifex/artifact/snapshot/version.lux b/stdlib/source/program/aedifex/artifact/snapshot/version.lux index 905523bd0..806d2b261 100644 --- a/stdlib/source/program/aedifex/artifact/snapshot/version.lux +++ b/stdlib/source/program/aedifex/artifact/snapshot/version.lux @@ -50,19 +50,14 @@ (..format_text .. value) (..format_text .. (///time.format updated))))) -(def: (sub tag parser) - (All [a] (-> xml.Tag (Parser a) (Parser a))) - (do <>.monad - [_ (.node tag)] - (.children parser))) - (def: (text tag) (-> xml.Tag (Parser Text)) - (..sub tag .text)) + (<| (.node tag) + .text)) (def: #export parser (Parser Version) - (<| (..sub ..) + (<| (.node ..) ($_ <>.and (.somewhere (..text ..)) (.somewhere (..text ..)) -- cgit v1.2.3