From 9e2f1e76f2c8df01ed7687d934c3210fcf676bd6 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 16 Jun 2022 00:48:19 -0400 Subject: De-sigil-ification: suffix : [Part 13] --- stdlib/source/program/aedifex/pom.lux | 68 +++++++++++++++++------------------ 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'stdlib/source/program/aedifex/pom.lux') diff --git a/stdlib/source/program/aedifex/pom.lux b/stdlib/source/program/aedifex/pom.lux index 3c966930a..0f5d3b50e 100644 --- a/stdlib/source/program/aedifex/pom.lux +++ b/stdlib/source/program/aedifex/pom.lux @@ -32,93 +32,93 @@ ... https://maven.apache.org/pom.html -(def: project_tag "project") -(def: dependency_tag "dependency") -(def: dependencies_tag "dependencies") -(def: repositories_tag "repositories") -(def: repository_tag "repository") -(def: url_tag "url") -(def: group_tag "groupId") -(def: artifact_tag "artifactId") -(def: version_tag "version") - -(def: .public file +(def project_tag "project") +(def dependency_tag "dependency") +(def dependencies_tag "dependencies") +(def repositories_tag "repositories") +(def repository_tag "repository") +(def url_tag "url") +(def group_tag "groupId") +(def artifact_tag "artifactId") +(def version_tag "version") + +(def .public file file.Path "pom.xml") -(def: version +(def version XML {_.#Node ["" "modelVersion"] _.attributes (list {_.#Text "4.0.0"})}) -(def: (property tag value) +(def (property tag value) (-> Text Text XML) {_.#Node ["" tag] _.attributes (list {_.#Text value})}) -(def: (artifact value) +(def (artifact value) (-> Artifact (List XML)) (list (..property ..group_tag (the //artifact.#group value)) (..property ..artifact_tag (the //artifact.#name value)) (..property ..version_tag (the //artifact.#version value)))) -(def: distribution +(def distribution (-> /.Distribution XML) (|>> (pipe.case {/.#Repo} "repo" {/.#Manual} "manual") (..property "distribution"))) -(def: (license [name url distribution]) +(def (license [name url distribution]) (-> /.License XML) (|> (list (..property "name" name) (..property ..url_tag url) (..distribution distribution)) {_.#Node ["" "license"] _.attributes})) -(def: repository +(def repository (-> Address XML) (|>> (..property ..url_tag) list {_.#Node ["" ..repository_tag] _.attributes})) -(def: (dependency value) +(def (dependency value) (-> Dependency XML) {_.#Node ["" ..dependency_tag] _.attributes (list#composite (..artifact (the //dependency.#artifact value)) (list (..property "type" (the //dependency.#type value))))}) -(def: (group tag) +(def (group tag) (-> Text (-> (List XML) XML)) (|>> {_.#Node ["" tag] _.attributes})) -(def: scm +(def scm (-> /.SCM XML) (|>> (..property ..url_tag) list {_.#Node ["" "scm"] _.attributes})) -(def: (organization [name url]) +(def (organization [name url]) (-> /.Organization XML) (|> (list (..property "name" name) (..property ..url_tag url)) {_.#Node ["" "organization"] _.attributes})) -(def: (developer_organization [name url]) +(def (developer_organization [name url]) (-> /.Organization (List XML)) (list (..property "organization" name) (..property "organizationUrl" url))) -(def: (developer' [name email organization]) +(def (developer' [name email organization]) (-> /.Developer (List XML)) (list.partial (..property "name" name) (..property "email" email) (|> organization (maybe#each ..developer_organization) (maybe.else (list))))) (with_template [ ] - [(def: + [(def (-> XML) (|>> ..developer' {_.#Node ["" ] _.attributes}))] @@ -126,7 +126,7 @@ [contributor /.Contributor "contributor"] ) -(def: (info value) +(def (info value) (-> /.Info (List XML)) (all list#composite (|> value (the /.#name) (maybe#each (..property "name")) maybe.list) @@ -139,7 +139,7 @@ (|> value (the /.#contributors) (list#each ..contributor) (..group "contributors") list) )) -(def: .public (write value) +(def .public (write value) (-> /.Profile (Try XML)) (case (the /.#identity value) {.#Some identity} @@ -159,7 +159,7 @@ _ (exception.except /.no_identity []))) -(def: property_parser +(def property_parser (Parser [Tag Text]) (do [! <>.monad] [tag .tag] @@ -167,7 +167,7 @@ (at ! each (|>> [tag])) .text))) -(def: (dependency_parser own_version parent_version) +(def (dependency_parser own_version parent_version) (-> Text Text (Parser Dependency)) (do [! <>.monad] [properties (at ! each (dictionary.of_list symbol.hash) @@ -189,33 +189,33 @@ (dictionary.value ["" "type"]) (maybe.else //artifact/type.jvm_library))]))))) -(def: (dependencies_parser own_version parent_version) +(def (dependencies_parser own_version parent_version) (-> Text Text (Parser (List Dependency))) (<| (.node ["" ..dependencies_tag]) (<>.some (..dependency_parser own_version parent_version)))) -(def: repository_parser +(def repository_parser (Parser Address) (<| (.node ["" ..repository_tag]) (.node ["" ..url_tag]) .text)) -(def: repositories_parser +(def repositories_parser (Parser (List Address)) (<| (.node ["" ..repositories_tag]) (<>.some ..repository_parser))) -(def: own_version +(def own_version (Parser Text) (<| (.node ["" ..version_tag]) .text)) -(def: parent_version +(def parent_version (Parser Text) (<| (.node ["" "parent"]) ..own_version)) -(def: .public parser +(def .public parser (Parser /.Profile) (do [! <>.monad] [own_version (<>.else "" (.somewhere ..own_version)) -- cgit v1.2.3