diff options
author | Eduardo Julian | 2020-12-17 22:03:54 -0400 |
---|---|---|
committer | Eduardo Julian | 2020-12-17 22:03:54 -0400 |
commit | 68b1dd82f23d6648ac3d9075a8f84b0174392945 (patch) | |
tree | 2db148a005c21552947d96dfd4e788ba21705037 /stdlib/source/program/aedifex/metadata | |
parent | abc5c5293603229b447b8b5dfa7f3275571ad982 (diff) |
More optimizations to the Lux syntax parser.
Diffstat (limited to 'stdlib/source/program/aedifex/metadata')
-rw-r--r-- | stdlib/source/program/aedifex/metadata/artifact.lux | 17 | ||||
-rw-r--r-- | stdlib/source/program/aedifex/metadata/snapshot.lux | 12 |
2 files changed, 18 insertions, 11 deletions
diff --git a/stdlib/source/program/aedifex/metadata/artifact.lux b/stdlib/source/program/aedifex/metadata/artifact.lux index 1f8068111..aa7b9abce 100644 --- a/stdlib/source/program/aedifex/metadata/artifact.lux +++ b/stdlib/source/program/aedifex/metadata/artifact.lux @@ -61,6 +61,7 @@ [<group> "groupId"] [<name> "artifactId"] [<version> "version"] + [<versioning> "versioning"] [<versions> "versions"] [<last-updated> "lastUpdated"] [<metadata> "metadata"] @@ -87,8 +88,10 @@ xml.attributes (list (..write-group (get@ #group value)) (..write-name (get@ #name value)) - (..write-versions (get@ #versions value)) - (..write-last-updated (get@ #last-updated value))))) + (#xml.Node ..<versioning> + xml.attributes + (list (..write-versions (get@ #versions value)) + (..write-last-updated (get@ #last-updated value))))))) (def: (sub tag parser) (All [a] (-> xml.Tag (Parser a) (Parser a))) @@ -136,9 +139,13 @@ ($_ <>.and (<xml>.somewhere (..text ..<group>)) (<xml>.somewhere (..text ..<name>)) - (<xml>.somewhere (<| (..sub ..<versions>) - (<>.many (..text ..<version>)))) - (<xml>.somewhere ..last-updated-parser) + (<| (..sub ..<versioning>) + ($_ <>.and + (<| <xml>.somewhere + (..sub ..<versions>) + (<>.many (..text ..<version>))) + (<xml>.somewhere ..last-updated-parser) + )) ))) (def: #export equivalence diff --git a/stdlib/source/program/aedifex/metadata/snapshot.lux b/stdlib/source/program/aedifex/metadata/snapshot.lux index a94ac33c4..1919d06ca 100644 --- a/stdlib/source/program/aedifex/metadata/snapshot.lux +++ b/stdlib/source/program/aedifex/metadata/snapshot.lux @@ -212,7 +212,7 @@ (Parser Build) (<text>.embed (<>.codec n.decimal (<text>.many <text>.decimal)) - (..text ..<timestamp>))) + (..text ..<build-number>))) (exception: #export (time-stamp-mismatch {expected Time-Stamp} {actual Text}) (exception.report @@ -226,7 +226,7 @@ (def: (snapshot-parser expected) (-> Value (Parser Type)) - (<| (..sub ..<snapshot-versions>) + (<| (..sub ..<snapshot-version>) (do <>.monad [#let [[version time-stamp build] expected] updated (<xml>.somewhere (..text ..<updated>)) @@ -243,8 +243,8 @@ (do <>.monad [[time-stamp build] (<| <xml>.somewhere (..sub ..<snapshot>) - (<>.and ..time-stamp-parser - ..build-parser)) + (<>.and (<xml>.somewhere ..time-stamp-parser) + (<xml>.somewhere ..build-parser))) last-updated (<xml>.somewhere ..last-updated-parser) _ (<>.assert (exception.construct ..time-stamp-mismatch [time-stamp (instant-format last-updated)]) (\ instant.equivalence = time-stamp last-updated)) @@ -268,7 +268,7 @@ #version version #versioning versioning})))) -(def: versioning +(def: versioning-equivalence (Equivalence Versioning) ($_ product.equivalence instant.equivalence @@ -282,5 +282,5 @@ text.equivalence text.equivalence text.equivalence - ..versioning + ..versioning-equivalence )) |