aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--documentation/book/the_lux_programming_language/appendix_h.md98
-rw-r--r--stdlib/project.lux96
-rw-r--r--stdlib/source/program/aedifex/format.lux8
-rw-r--r--stdlib/source/program/aedifex/parser.lux29
-rw-r--r--stdlib/source/test/aedifex/input.lux3
-rw-r--r--stdlib/source/test/aedifex/parser.lux69
6 files changed, 135 insertions, 168 deletions
diff --git a/documentation/book/the_lux_programming_language/appendix_h.md b/documentation/book/the_lux_programming_language/appendix_h.md
index a4ba8d6b1..e766963c6 100644
--- a/documentation/book/the_lux_programming_language/appendix_h.md
+++ b/documentation/book/the_lux_programming_language/appendix_h.md
@@ -124,95 +124,95 @@ Now that we have seen the available commands, it would be useful to see an annot
[... An optional identity for the project.
... It can also be specified or overriden in a non-default profile.
... This will be the name given to the project when installed/deployed as a dependency.
- #identity ["com.github.luxlang" "stdlib" "0.6.0"]
-
- ... Every piece of information, and the whole #info bundle, are optional.
- #info [#url "https://github.com/LuxLang/lux"
- #scm "https://github.com/LuxLang/lux.git"
- #licenses [[#name "Lux License v0.1.1"
- #url "https://github.com/LuxLang/lux/blob/master/license.txt"
- #type #repo]]
- ... #organization [[#name "Lux Foundation"
- ... #url "http://example.com/lux_foundation"]]
- #developers [[#name "Eduardo Julian"
- #url "https://github.com/eduardoejp"
- ... #organization [#name "Lux Foundation"
- ... #url "http://example.com/lux_foundation"]
- ]]
- ... #contributors [[#name "Eduardo Julian"
- ... #url "https://github.com/eduardoejp"
- ... #organization [#name "Lux Foundation"
- ... #url "http://example.com/lux_foundation"]]]
- ]
+ "identity" ["com.github.luxlang" "stdlib" "0.6.0-SNAPSHOT"]
+
+ ... Every piece of information, and the whole "info" bundle, are optional.
+ "info" ["url" "https://github.com/LuxLang/lux"
+ "scm" "https://github.com/LuxLang/lux.git"
+ "licenses" [["name" "Lux License v0.1.1"
+ "url" "https://github.com/LuxLang/lux/blob/master/license.txt"
+ "type" "repo"]]
+ ... "organization" [["name" "Lux Foundation"
+ ... "url" "http://example.com/lux_foundation"]]
+ "developers" [["name" "Eduardo Julian"
+ "url" "https://github.com/eduardoejp"
+ ... "organization" ["name" "Lux Foundation"
+ ... "url" "http://example.com/lux_foundation"]
+ ]]
+ ... #contributors [["name" "Eduardo Julian"
+ ... "url" "https://github.com/eduardoejp"
+ ... "organization" ["name" "Lux Foundation"
+ ... "url" "http://example.com/lux_foundation"]]]
+ ]
... An optional list of repositories you can deploy to, given aliases so they're easy to refer to with the "deploy" command.
- #deploy_repositories ["snapshots" "https://oss.sonatype.org/content/repositories/snapshots/"
- "releases" "https://oss.sonatype.org/service/local/staging/deploy/maven2/"]
+ "deploy_repositories" ["snapshots" "https://oss.sonatype.org/content/repositories/snapshots/"
+ "releases" "https://oss.sonatype.org/service/local/staging/deploy/maven2/"]
... An optional list of repositories to use for fetching remote dependencies.
... Additionally, there is an implicit repository being used, which is https://repo1.maven.org/maven2/
- ... So, even if the #repositories list were to be empty, you'd still have access to the default repository.
- #repositories ["https://oss.sonatype.org/content/repositories/snapshots/"
- "https://oss.sonatype.org/service/local/staging/deploy/maven2/"]
+ ... So, even if the "repositories" list were to be empty, you'd still have access to the default repository.
+ "repositories" ["https://oss.sonatype.org/content/repositories/snapshots/"
+ "https://oss.sonatype.org/service/local/staging/deploy/maven2/"]
... The different directories to look for source code. The default is described below.
- ... #sources ["source"]
+ ... "sources" ["source"]
... The directory for storing the build artifacts. The default is described below.
- ... #target "target"
+ ... "target" "target"
]
... The following are alternative profiles to use in various situations.
"jvm"
- [... #compiler specifies the dependency to fetch and use as the compiler.
- #compiler ["com.github.luxlang" "lux-jvm" "0.6.0" "jar"]
- ... #dependencies is an optional list of dependencies to fetch.
+ [... "compiler" specifies the dependency to fetch and use as the compiler.
+ "compiler" ["com.github.luxlang" "lux-jvm" "0.6.0-SNAPSHOT" "jar"]
+ ... "dependencies" is an optional list of dependencies to fetch.
... The dependencies have the same shape as when specifying the compiler.
... When omitting the packaging format of the dependency, "tar" will be assumed.
- ... #dependencies [["org.ow2.asm" "asm-all" "5.0.3" "jar"]
- ... ["com.github.luxlang" "stdlib" "0.6.0"]]
+ ... "dependencies" [["org.ow2.asm" "asm-all" "5.0.3" "jar"]
+ ... ["com.github.luxlang" "stdlib" "0.6.0"]]
... The OS command to use when running JVM tests. The default is described below.
- ... #java ["java" "-jar"]
+ ... "java" ["java" "-jar"]
]
"js"
- [#compiler ["com.github.luxlang" "lux-js" "0.6.0" "js"]
+ ["compiler" ["com.github.luxlang" "lux-js" "0.6.0-SNAPSHOT" "js"]
... The OS command to use when running JS tests. The default is described below.
- ... #js ["node" "--stack_size=8192"]
+ ... "js" ["node" "--stack_size=8192"]
]
"python"
- [#compiler ["com.github.luxlang" "lux-python" "0.6.0" "jar"]
+ ["compiler" ["com.github.luxlang" "lux-python" "0.6.0-SNAPSHOT" "jar"]
... The OS command to use when running Python tests. The default is described below.
- ... #python ["python3"]
+ ... "python" ["python3"]
]
"lua"
- [#compiler ["com.github.luxlang" "lux-lua" "0.6.0" "jar"]
+ ["compiler" ["com.github.luxlang" "lux-lua" "0.6.0-SNAPSHOT" "jar"]
... The OS command to use when running Lua tests. The default is described below.
- ... #lua ["lua"]
+ ... "lua" ["lua"]
]
"ruby"
- [#compiler ["com.github.luxlang" "lux-ruby" "0.6.0" "jar"]
+ ["compiler" ["com.github.luxlang" "lux-ruby" "0.6.0-SNAPSHOT" "jar"]
... The OS command to use when running Ruby tests. The default is described below.
- ... #ruby ["ruby"]
+ ... "ruby" ["ruby"]
]
"bibliotheca"
- [#info [#description "Standard library for the Lux programming language."]
- #test "test/lux"]
+ ["info" ["description" "Standard library for the Lux programming language."]
+ "test" "test/lux"]
"documentation"
- [#program "documentation/lux"
- #test "documentation/lux"]
+ ["program" "documentation/lux"
+ "test" "documentation/lux"]
"aedifex"
- [#info [#description "A build system/tool made exclusively for Lux."]
+ ["info" ["description" "A build system/tool made exclusively for Lux."]
... Parent profiles to this one.
... Specifying them here is like automatically using Aedifex's "with" command.
- #parents ["jvm"]
+ "parents" ["jvm"]
... The name of the main module of the program.
- #program "program/aedifex"
+ "program" "program/aedifex"
... The name of the main module where the tests are located.
- #test "test/aedifex"]]
+ "test" "test/aedifex"]]
```
diff --git a/stdlib/project.lux b/stdlib/project.lux
index 760dfc738..83b09c7f6 100644
--- a/stdlib/project.lux
+++ b/stdlib/project.lux
@@ -2,93 +2,93 @@
[... An optional identity for the project.
... It can also be specified or overriden in a non-default profile.
... This will be the name given to the project when installed/deployed as a dependency.
- #identity ["com.github.luxlang" "stdlib" "0.6.0-SNAPSHOT"]
+ "identity" ["com.github.luxlang" "stdlib" "0.6.0-SNAPSHOT"]
- ... Every piece of information, and the whole #info bundle, are optional.
- #info [#url "https://github.com/LuxLang/lux"
- #scm "https://github.com/LuxLang/lux.git"
- #licenses [[#name "Lux License v0.1.1"
- #url "https://github.com/LuxLang/lux/blob/master/license.txt"
- #type #repo]]
- ... #organization [[#name "Lux Foundation"
- ... #url "http://example.com/lux_foundation"]]
- #developers [[#name "Eduardo Julian"
- #url "https://github.com/eduardoejp"
- ... #organization [#name "Lux Foundation"
- ... #url "http://example.com/lux_foundation"]
- ]]
- ... #contributors [[#name "Eduardo Julian"
- ... #url "https://github.com/eduardoejp"
- ... #organization [#name "Lux Foundation"
- ... #url "http://example.com/lux_foundation"]]]
- ]
+ ... Every piece of information, and the whole "info" bundle, are optional.
+ "info" ["url" "https://github.com/LuxLang/lux"
+ "scm" "https://github.com/LuxLang/lux.git"
+ "licenses" [["name" "Lux License v0.1.1"
+ "url" "https://github.com/LuxLang/lux/blob/master/license.txt"
+ "type" "repo"]]
+ ... "organization" [["name" "Lux Foundation"
+ ... "url" "http://example.com/lux_foundation"]]
+ "developers" [["name" "Eduardo Julian"
+ "url" "https://github.com/eduardoejp"
+ ... "organization" ["name" "Lux Foundation"
+ ... "url" "http://example.com/lux_foundation"]
+ ]]
+ ... #contributors [["name" "Eduardo Julian"
+ ... "url" "https://github.com/eduardoejp"
+ ... "organization" ["name" "Lux Foundation"
+ ... "url" "http://example.com/lux_foundation"]]]
+ ]
... An optional list of repositories you can deploy to, given aliases so they're easy to refer to with the "deploy" command.
- #deploy_repositories ["snapshots" "https://oss.sonatype.org/content/repositories/snapshots/"
- "releases" "https://oss.sonatype.org/service/local/staging/deploy/maven2/"]
+ "deploy_repositories" ["snapshots" "https://oss.sonatype.org/content/repositories/snapshots/"
+ "releases" "https://oss.sonatype.org/service/local/staging/deploy/maven2/"]
... An optional list of repositories to use for fetching remote dependencies.
... Additionally, there is an implicit repository being used, which is https://repo1.maven.org/maven2/
- ... So, even if the #repositories list were to be empty, you'd still have access to the default repository.
- #repositories ["https://oss.sonatype.org/content/repositories/snapshots/"
- "https://oss.sonatype.org/service/local/staging/deploy/maven2/"]
+ ... So, even if the "repositories" list were to be empty, you'd still have access to the default repository.
+ "repositories" ["https://oss.sonatype.org/content/repositories/snapshots/"
+ "https://oss.sonatype.org/service/local/staging/deploy/maven2/"]
... The different directories to look for source code. The default is described below.
- ... #sources ["source"]
+ ... "sources" ["source"]
... The directory for storing the build artifacts. The default is described below.
- ... #target "target"
+ ... "target" "target"
]
... The following are alternative profiles to use in various situations.
"jvm"
- [... #compiler specifies the dependency to fetch and use as the compiler.
- #compiler ["com.github.luxlang" "lux-jvm" "0.6.0-SNAPSHOT" "jar"]
- ... #dependencies is an optional list of dependencies to fetch.
+ [... "compiler" specifies the dependency to fetch and use as the compiler.
+ "compiler" ["com.github.luxlang" "lux-jvm" "0.6.0-SNAPSHOT" "jar"]
+ ... "dependencies" is an optional list of dependencies to fetch.
... The dependencies have the same shape as when specifying the compiler.
... When omitting the packaging format of the dependency, "tar" will be assumed.
- ... #dependencies [["org.ow2.asm" "asm-all" "5.0.3" "jar"]
- ... ["com.github.luxlang" "stdlib" "0.6.0"]]
+ ... "dependencies" [["org.ow2.asm" "asm-all" "5.0.3" "jar"]
+ ... ["com.github.luxlang" "stdlib" "0.6.0"]]
... The OS command to use when running JVM tests. The default is described below.
- ... #java ["java" "-jar"]
+ ... "java" ["java" "-jar"]
]
"js"
- [#compiler ["com.github.luxlang" "lux-js" "0.6.0-SNAPSHOT" "js"]
+ ["compiler" ["com.github.luxlang" "lux-js" "0.6.0-SNAPSHOT" "js"]
... The OS command to use when running JS tests. The default is described below.
- ... #js ["node" "--stack_size=8192"]
+ ... "js" ["node" "--stack_size=8192"]
]
"python"
- [#compiler ["com.github.luxlang" "lux-python" "0.6.0-SNAPSHOT" "jar"]
+ ["compiler" ["com.github.luxlang" "lux-python" "0.6.0-SNAPSHOT" "jar"]
... The OS command to use when running Python tests. The default is described below.
- ... #python ["python3"]
+ ... "python" ["python3"]
]
"lua"
- [#compiler ["com.github.luxlang" "lux-lua" "0.6.0-SNAPSHOT" "jar"]
+ ["compiler" ["com.github.luxlang" "lux-lua" "0.6.0-SNAPSHOT" "jar"]
... The OS command to use when running Lua tests. The default is described below.
- ... #lua ["lua"]
+ ... "lua" ["lua"]
]
"ruby"
- [#compiler ["com.github.luxlang" "lux-ruby" "0.6.0-SNAPSHOT" "jar"]
+ ["compiler" ["com.github.luxlang" "lux-ruby" "0.6.0-SNAPSHOT" "jar"]
... The OS command to use when running Ruby tests. The default is described below.
- ... #ruby ["ruby"]
+ ... "ruby" ["ruby"]
]
"bibliotheca"
- [#info [#description "Standard library for the Lux programming language."]
- #test "test/lux"]
+ ["info" ["description" "Standard library for the Lux programming language."]
+ "test" "test/lux"]
"documentation"
- [#program "documentation/lux"
- #test "documentation/lux"]
+ ["program" "documentation/lux"
+ "test" "documentation/lux"]
"aedifex"
- [#info [#description "A build system/tool made exclusively for Lux."]
+ ["info" ["description" "A build system/tool made exclusively for Lux."]
... Parent profiles to this one.
... Specifying them here is like automatically using Aedifex's "with" command.
- #parents ["jvm"]
+ "parents" ["jvm"]
... The name of the main module of the program.
- #program "program/aedifex"
+ "program" "program/aedifex"
... The name of the main module where the tests are located.
- #test "test/aedifex"]]
+ "test" "test/aedifex"]]
diff --git a/stdlib/source/program/aedifex/format.lux b/stdlib/source/program/aedifex/format.lux
index af03bf827..f6b737fdf 100644
--- a/stdlib/source/program/aedifex/format.lux
+++ b/stdlib/source/program/aedifex/format.lux
@@ -27,10 +27,10 @@
#url (~ (code.text url))
#type (~ (case type
#/.Repo
- (' #repo)
+ (' "repo")
#/.Manual
- (' #manual)))]))
+ (' "manual")))]))
(def: (organization [name url])
(Format /.Organization)
@@ -60,7 +60,7 @@
(Format Aggregate)
(|>> dictionary.entries
(list\each (function (_ [key value])
- (list (code.local_tag key) value)))
+ (list (code.text key) value)))
list\conjoint
code.tuple))
@@ -141,7 +141,7 @@
(` [(~ (code.text program))
(~+ (list\each code.text parameters))]))
-(def: .public (profile value)
+(def: (profile value)
(Format /.Profile)
(`` (|> ..empty
(..on_list "parents" (value@ #/.parents value) code.text)
diff --git a/stdlib/source/program/aedifex/parser.lux b/stdlib/source/program/aedifex/parser.lux
index 0284d3ced..315021712 100644
--- a/stdlib/source/program/aedifex/parser.lux
+++ b/stdlib/source/program/aedifex/parser.lux
@@ -84,22 +84,22 @@
(do {! <>.monad}
[input (\ ! each
(dictionary.of_list text.hash)
- (<code>.tuple (<>.some (<>.and <code>.local_tag
+ (<code>.tuple (<>.some (<>.and <code>.text
<code>.any))))]
($_ <>.and
(..singular input "name" ..name)
(..singular input "url" ..url)
(<>.else #/.Repo
(..singular input "type"
- (<>.or (<code>.this! (' #repo))
- (<code>.this! (' #manual))))))))
+ (<>.or (<code>.this! (' "repo"))
+ (<code>.this! (' "manual"))))))))
(def: organization
(Parser /.Organization)
(do {! <>.monad}
[input (\ ! each
(dictionary.of_list text.hash)
- (<code>.tuple (<>.some (<>.and <code>.local_tag
+ (<code>.tuple (<>.some (<>.and <code>.text
<code>.any))))]
($_ <>.and
(..singular input "name" ..name)
@@ -110,7 +110,7 @@
(do {! <>.monad}
[input (\ ! each
(dictionary.of_list text.hash)
- (<code>.tuple (<>.some (<>.and <code>.local_tag
+ (<code>.tuple (<>.some (<>.and <code>.text
<code>.any))))]
($_ <>.and
(..singular input "name" ..name)
@@ -127,7 +127,7 @@
(do {! <>.monad}
[input (\ ! each
(dictionary.of_list text.hash)
- (<code>.tuple (<>.some (<>.and <code>.local_tag
+ (<code>.tuple (<>.some (<>.and <code>.text
<code>.any))))]
($_ <>.and
(<>.maybe (..singular input "url" ..url))
@@ -183,7 +183,7 @@
(do {! <>.monad}
[input (\ ! each
(dictionary.of_list text.hash)
- (<code>.tuple (<>.some (<>.and <code>.local_tag
+ (<code>.tuple (<>.some (<>.and <code>.text
<code>.any))))
.let [^parents (: (Parser (List /.Name))
(<>.else (list)
@@ -260,14 +260,7 @@
(def: .public project
(Parser Project)
- (let [default_profile (: (Parser Project)
- (\ <>.monad each
- (|>> [/.default] (list) (dictionary.of_list text.hash))
- ..profile))
- multi_profile (: (Parser Project)
- (\ <>.monad each
- (dictionary.of_list text.hash)
- (<code>.tuple (<>.many (<>.and <code>.text
- ..profile)))))]
- (<>.either multi_profile
- default_profile)))
+ (\ <>.monad each
+ (dictionary.of_list text.hash)
+ (<code>.tuple (<>.many (<>.and <code>.text
+ ..profile)))))
diff --git a/stdlib/source/test/aedifex/input.lux b/stdlib/source/test/aedifex/input.lux
index 39dec3ced..eef2673f8 100644
--- a/stdlib/source/test/aedifex/input.lux
+++ b/stdlib/source/test/aedifex/input.lux
@@ -51,7 +51,8 @@
(in (do async.monad
[verdict (do //action.monad
[.let [profile (|> expected
- //format.profile
+ (//project.project //.default)
+ //format.project
%.code
(\ utf8.codec encoded))]
_ (\ fs write profile //project.file)
diff --git a/stdlib/source/test/aedifex/parser.lux b/stdlib/source/test/aedifex/parser.lux
index 7d15e6dda..cb72c3726 100644
--- a/stdlib/source/test/aedifex/parser.lux
+++ b/stdlib/source/test/aedifex/parser.lux
@@ -66,61 +66,34 @@
(-> //.Profile //.Profile)
(revised@ #//.repositories (set.has //.default_repository)))
-(def: single_profile
- Test
- (do random.monad
- [expected @profile.random]
- (_.test "Single profile."
- (|> expected
- //format.profile
- list
- (<code>.result /.project)
- (case> (#try.Success actual)
- (|> expected
- ..with_default_sources
- ..with_default_repository
- (//project.project //.default)
- (\ //project.equivalence = actual))
-
- (#try.Failure error)
- false)))))
-
(def: (with_empty_profile project)
(-> Project Project)
(if (dictionary.empty? project)
(//project.project //.default (\ //.monoid identity))
project))
-(def: multiple_profiles
- Test
- (do random.monad
- [expected ..random]
- (_.test "Multiple profiles."
- (|> expected
- //format.project
- list
- (<code>.result /.project)
- (case> (#try.Success actual)
- (|> expected
- ..with_empty_profile
- dictionary.entries
- (list\each (function (_ [name profile])
- [name (|> profile
- ..with_default_sources
- ..with_default_repository)]))
- (dictionary.of_list text.hash)
- (\ //project.equivalence = actual))
-
- (#try.Failure error)
- false)))))
-
(def: .public test
Test
(<| (_.covering /._)
(_.covering //format._)
- (_.for [/.project
- //format.Format //format.profile //format.project]
- ($_ _.and
- ..single_profile
- ..multiple_profiles
- ))))
+ (do random.monad
+ [expected ..random]
+ (_.cover [/.project
+ //format.Format //format.project]
+ (|> expected
+ //format.project
+ list
+ (<code>.result /.project)
+ (case> (#try.Success actual)
+ (|> expected
+ ..with_empty_profile
+ dictionary.entries
+ (list\each (function (_ [name profile])
+ [name (|> profile
+ ..with_default_sources
+ ..with_default_repository)]))
+ (dictionary.of_list text.hash)
+ (\ //project.equivalence = actual))
+
+ (#try.Failure error)
+ false))))))