aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-11-11 18:34:20 -0800
committerBruce Hill <bruce@bruce-hill.com>2018-11-11 18:34:31 -0800
commitc9db20040e4830744d4f04ccbc26c03486dda754 (patch)
tree476e2c0979f6b2b67f5ebf7ff78c773f4483b75c
parent171e9d674e4ae85e303c90679ad47bceda3b3810 (diff)
Fixed compatibility thing with NomsuCode::from
-rw-r--r--compatibility/4.10.12.7.nom2
-rw-r--r--nomsu_environment.lua6
-rw-r--r--nomsu_environment.moon2
-rwxr-xr-xtools/autoformat.nom2
-rwxr-xr-xtools/find_action.nom2
-rwxr-xr-xtools/upgrade.nom2
6 files changed, 12 insertions, 4 deletions
diff --git a/compatibility/4.10.12.7.nom b/compatibility/4.10.12.7.nom
index 40d6eac..56cdb1e 100644
--- a/compatibility/4.10.12.7.nom
+++ b/compatibility/4.10.12.7.nom
@@ -38,7 +38,7 @@ upgrade action (%k = %v for %i in %start to %stop via %step) to "4.10.12.7" as {
: for %i in %start to %stop by %step: add %k = %v
upgrade action (parse %text from %filename) to "4.10.12.7" as (..)
- (%NomsuCode (%Source %filename 1 (size of %text))) parsed
+ (NomsuCode from (Source %filename 1 (size of %text)) %text) parsed
upgrade action (% as lua statements) to "4.10.12.7" as (% as lua)
upgrade action (compile error at %pos %err hint %hint) to "4.10.12.7" as (..)
diff --git a/nomsu_environment.lua b/nomsu_environment.lua
index 4345947..41f7cd6 100644
--- a/nomsu_environment.lua
+++ b/nomsu_environment.lua
@@ -104,6 +104,12 @@ local nomsu_environment = Importer({
LuaCode = LuaCode,
NomsuCode = NomsuCode,
Source = Source,
+ LuaCode_from = (function(src, ...)
+ return LuaCode:from(src, ...)
+ end),
+ NomsuCode_from = (function(src, ...)
+ return NomsuCode:from(src, ...)
+ end),
SOURCE_MAP = Importer({ }),
_1_as_nomsu = tree_to_nomsu,
_1_as_inline_nomsu = tree_to_inline_nomsu,
diff --git a/nomsu_environment.moon b/nomsu_environment.moon
index 37f239d..142abdb 100644
--- a/nomsu_environment.moon
+++ b/nomsu_environment.moon
@@ -48,6 +48,8 @@ nomsu_environment = Importer{
lpeg:lpeg, re:re, Files:Files,
:SyntaxTree, TESTS: Dict({}), globals: Dict({}),
:LuaCode, :NomsuCode, :Source
+ LuaCode_from: ((src, ...)-> LuaCode\from(src, ...)),
+ NomsuCode_from: ((src, ...)-> NomsuCode\from(src, ...)),
SOURCE_MAP: Importer({})
-- Nomsu functions:
diff --git a/tools/autoformat.nom b/tools/autoformat.nom
index b15f4ce..3082a9e 100755
--- a/tools/autoformat.nom
+++ b/tools/autoformat.nom
@@ -19,7 +19,7 @@ for %path in %args:
for file %filename in %path:
unless (%filename::matches "%.nom$"): do next %filename
%contents = (read file %filename)
- %code = (%NomsuCode::from (Source %filename 1 (size of %contents)) %contents)
+ %code = (NomsuCode from (Source %filename 1 (size of %contents)) %contents)
%tree = (%code parsed)
%formatted = ((%tree as nomsu)::text)
if %inplace:
diff --git a/tools/find_action.nom b/tools/find_action.nom
index a6be84f..21482d3 100755
--- a/tools/find_action.nom
+++ b/tools/find_action.nom
@@ -16,7 +16,7 @@ for %path in %files:
for file %filename in %path:
unless (%filename::matches "%.nom$"): do next %filename
%file = (read file %filename)
- %code = (%NomsuCode (%Source %filename 1 (size of %file)) %file)
+ %code = (NomsuCode from (%Source %filename 1 (size of %file)) %file)
try:
%tree = (%code parsed)
..and if it barfs %msg:
diff --git a/tools/upgrade.nom b/tools/upgrade.nom
index 469a127..5f50f73 100755
--- a/tools/upgrade.nom
+++ b/tools/upgrade.nom
@@ -41,7 +41,7 @@ for %path in %args:
for file %filename in %path:
unless (%filename::matches "%.nom$"): do next %filename
%file = (read file %filename)
- %code = (%NomsuCode::from (%Source %filename 1 (size of %file)) %file)
+ %code = (NomsuCode from (%Source %filename 1 (size of %file)) %file)
%tree = (%code parsed)
%uptree = (..)
%tree upgraded from (%start_version or (%tree.version or (Nomsu version))) to \