aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2017-12-14 13:57:53 -0800
committerBruce Hill <bitbucket@bruce-hill.com>2017-12-14 13:57:53 -0800
commit1111210047f3ca62a2fec5d0ca20bce5cad25f12 (patch)
tree655240596e2fecee43925755af8fb36c46e5daee /lib
parent10659d2f370f3a8d8ab521cf5eea45ebae536faf (diff)
Updating some more stuff.
Diffstat (limited to 'lib')
-rw-r--r--lib/plurals.nom26
-rw-r--r--lib/secrets.nom8
-rw-r--r--lib/testing.nom10
3 files changed, 22 insertions, 22 deletions
diff --git a/lib/plurals.nom b/lib/plurals.nom
index a1c293f..85938e9 100644
--- a/lib/plurals.nom
+++ b/lib/plurals.nom
@@ -4,19 +4,19 @@ require "lib/secrets.nom"
# Plurals
with secrets:
lua do> ".."
- |local endings = setmetatable({x="es",c="es",s="es"}, {__index=function() return "s"; end});
- |secrets.plurals = setmetatable({}, {__index=function(self,key)
- | return key..endings[key:sub(-1)];
- |end});
- |secrets.singulars = setmetatable({}, {__index=function(self,key)
- | if key:sub(-2) == "es" and rawget(endings, key:sub(-3,-3)) then return key:sub(1,-3); end
- | if key:sub(-1) == "s" then return key:sub(1,-2); end
- | return key;
- |end});
- |secrets.canonicals = setmetatable({}, {__index=function(self,key)
- | if key:sub(-1) == "s" then return secrets.singulars[key]; end
- | return key;
- |end});
+ local endings = setmetatable({x="es",c="es",s="es"}, {__index=function() return "s"; end});
+ secrets.plurals = setmetatable({}, {__index=function(self,key)
+ return key..endings[key:sub(-1)];
+ end});
+ secrets.singulars = setmetatable({}, {__index=function(self,key)
+ if key:sub(-2) == "es" and rawget(endings, key:sub(-3,-3)) then return key:sub(1,-3); end
+ if key:sub(-1) == "s" then return key:sub(1,-2); end
+ return key;
+ end});
+ secrets.canonicals = setmetatable({}, {__index=function(self,key)
+ if key:sub(-1) == "s" then return secrets.singulars[key]; end
+ return key;
+ end});
rule [the plural of %singular is %plural] =:
(secret %plurals)->%singular = %plural
diff --git a/lib/secrets.nom b/lib/secrets.nom
index 76bf6b3..0b9b1b1 100644
--- a/lib/secrets.nom
+++ b/lib/secrets.nom
@@ -1,10 +1,10 @@
require "lib/core.nom"
compile [with secrets %block] to code: ".."
- |do;
- | local secrets = {};
- | \(%block as lua statements)
- |end;
+ do
+ local secrets = {};
+ \(%block as lua statements)
+ end
# Access the lua variable that should be within scope
compile [secrets] to: "secrets"
diff --git a/lib/testing.nom b/lib/testing.nom
index 336be38..447922b 100644
--- a/lib/testing.nom
+++ b/lib/testing.nom
@@ -4,10 +4,10 @@ require "lib/metaprogramming.nom"
rule [test tree %generated == %expected] =:
if (%generated != %expected):
error ".."
- |Test Failed!
- |Expected:
- |\(%expected)
- |But got:
- |\(%generated)
+ Test Failed!
+ Expected:
+ \(%expected)
+ But got:
+ \(%generated)
parse [test %code yields %expected] as:
test tree (nomsu "tree_to_str" [\%code]) == %expected