diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-18 01:04:16 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-18 01:04:57 -0700 |
| commit | c7c657d38f999901225b33482ef3a15994526feb (patch) | |
| tree | a4c2b843b31bd7d573a479b43512bf8dec99187b /core | |
| parent | 88df5c72a317cc011f221627a2c3082078237cc1 (diff) | |
Prep work for next big upgrade, including adding a shorthand for
upgrading actions similarly to 'parse % as %'
Diffstat (limited to 'core')
| -rw-r--r-- | core/collections.nom | 3 | ||||
| -rw-r--r-- | core/metaprogramming.nom | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/core/collections.nom b/core/collections.nom index 100781b..d99ae49 100644 --- a/core/collections.nom +++ b/core/collections.nom @@ -62,6 +62,9 @@ compile [..] to %list append %item ..to (Lua "table.insert(\(%list as lua expr), \(%item as lua expr))") +compile [add %item to %list at index %i] to (..) + Lua "table.insert(\(%list as lua expr), \(%i as lua expr), \(%item as lua expr))" + compile [pop from %list, remove last from %list] to (..) Lua value "table.remove(\(%list as lua expr))" diff --git a/core/metaprogramming.nom b/core/metaprogramming.nom index f78ab50..c81eb74 100644 --- a/core/metaprogramming.nom +++ b/core/metaprogramming.nom @@ -3,7 +3,7 @@ This File contains actions for making actions and compile-time actions and some helper functions to make that easier. -lua> "NOMSU_CORE_VERSION = 2" +lua> "NOMSU_CORE_VERSION = 3" lua> ".." nomsu.COMPILE_ACTIONS["% -> %"] = function(nomsu, tree, \%args, \%body) local lua = LuaCode.Value(tree.source, "function(") |
