aboutsummaryrefslogtreecommitdiff
path: root/lib/collections.nom
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2017-10-19 17:00:10 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2017-10-19 17:00:10 -0700
commitb98059261c173dab8d919e7f9a93d44c5de0329d (patch)
treeb7fdbfe9c746dc2f52a25e0dd2715c769a371d8c /lib/collections.nom
parent443f8c73bb67e2fb085c5595add10b98f4696805 (diff)
Abbreviated "lua code" to "lua>" and "lua expr" to "=lua" and "lua
block" to "lua do>"
Diffstat (limited to 'lib/collections.nom')
-rw-r--r--lib/collections.nom12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/collections.nom b/lib/collections.nom
index 9432baa..1d22bb6 100644
--- a/lib/collections.nom
+++ b/lib/collections.nom
@@ -101,10 +101,10 @@ compile [dict %items] to:
|Invalid format for 'dict' expression. Only literals are allowed.
%tokens = (%func_call's "value")
%equals = (%tokens -> 2)
- assert (lua expr "#\(%tokens) == 3 and \(%equals) and \(%equals).type == 'Word' and \(%equals).value == '='") ".."
+ assert (=lua "#\(%tokens) == 3 and \(%equals) and \(%equals).type == 'Word' and \(%equals).value == '='") ".."
|Invalid format for 'dict' expression. Lines must only have the "% = %" format, not \(%func_call's "src")
%key = (%tokens -> 1)
- lua code ".."
+ lua> ".."
|if \(%key).type == "Word" and \(%key).value:match("^[a-zA-Z_][a-zA-Z0-9_]*$") then
| \(%key_code) = \(%key).value;
|elseif \(%key).type == "Word" then
@@ -117,7 +117,7 @@ compile [dict %items] to:
..else:
return (..)
(..)
- nomsu "replaced_vars" [\(dict from entries %items), lua expr "vars"]
+ nomsu "replaced_vars" [\(dict from entries %items), =lua "vars"]
..as lua
rule [entries in %dict] =:
@@ -171,11 +171,11 @@ compile [default dict] to: ".."
rule [chain %dict to %fallback] =:
when (type of %fallback) == ?:
* "table":
- lua expr "setmetatable(\(%dict), \(%fallback))"
+ =lua "setmetatable(\(%dict), \(%fallback))"
* "function":
- lua expr "setmetatable(\(%dict), {__index=function(self, key) return (\(%fallback))(nomsu, {['']=key, self=self}); end})"
+ =lua "setmetatable(\(%dict), {__index=function(self, key) return (\(%fallback))(nomsu, {['']=key, self=self}); end})"
* else:
- lua expr "setmetatable(\(%dict), {__index=function(self, key) return (\(%fallback)); end})"
+ =lua "setmetatable(\(%dict), {__index=function(self, key) return (\(%fallback)); end})"
# TODO: maybe make a generator/coroutine?