aboutsummaryrefslogtreecommitdiff
path: root/nomsu.moon
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2017-09-22 11:56:46 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2017-09-22 11:56:46 -0700
commite4660b169c14d24c3ec373b197e8b9469d200d50 (patch)
treeb9576e166caf1dcb994b7fe9162baa1a6a97756e /nomsu.moon
parent6882862d0ff226d73bc6a010d335896c44d8cde9 (diff)
Renamed compiler -> nomsu for concision and clarity.
Diffstat (limited to 'nomsu.moon')
-rwxr-xr-xnomsu.moon14
1 files changed, 7 insertions, 7 deletions
diff --git a/nomsu.moon b/nomsu.moon
index d274c6e..8d5dd43 100755
--- a/nomsu.moon
+++ b/nomsu.moon
@@ -272,7 +272,7 @@ class NomsuCompiler
tree_to_value: (tree, vars)=>
code = "
- return (function(compiler, vars)\nreturn #{@tree_to_lua(tree)}\nend)"
+ return (function(nomsu, vars)\nreturn #{@tree_to_lua(tree)}\nend)"
lua_thunk, err = load(code)
if not lua_thunk
error("Failed to compile generated code:\n#{code}\n\n#{err}")
@@ -284,7 +284,7 @@ class NomsuCompiler
@error "Invalid tree: #{repr(tree)}"
switch tree.type
when "File"
- buffer = {[[return (function(compiler, vars)
+ buffer = {[[return (function(nomsu, vars)
local ret]]}
vars = {}
for statement in *tree.value.body.value
@@ -294,7 +294,7 @@ class NomsuCompiler
error(code)
-- Run the fuckers as we go
lua_code = "
- return (function(compiler, vars)\n#{code}\nend)"
+ return (function(nomsu, vars)\n#{code}\nend)"
lua_thunk, err = load(lua_code)
if not lua_thunk
error("Failed to compile generated code:\n#{code}\n\n#{err}\n\nProduced by statement:\n#{repr(statement)}")
@@ -322,11 +322,11 @@ class NomsuCompiler
if #tree.value.value == 1
if ret_value = lua\match("^%s*ret = (.*)")
return ([[
- (function(compiler, vars)
+ (function(nomsu, vars)
return %s
end)]])\format(ret_value)
return ([[
- (function(compiler, vars)
+ (function(nomsu, vars)
local ret
%s
return ret
@@ -347,7 +347,7 @@ class NomsuCompiler
else
args = [@tree_to_lua(a) for a in *tree.value when a.type != "Word"]
insert args, 1, repr(alias)
- return @@comma_separated_items("compiler:call(", args, ")")
+ return @@comma_separated_items("nomsu:call(", args, ")")
when "String"
return repr(@@unescape_string(tree.value))
@@ -364,7 +364,7 @@ class NomsuCompiler
if string_buffer ~= ""
insert concat_parts, repr(string_buffer)
string_buffer = ""
- insert concat_parts, "compiler.utils.repr_if_not_string(#{@tree_to_lua(bit)})"
+ insert concat_parts, "nomsu.utils.repr_if_not_string(#{@tree_to_lua(bit)})"
if string_buffer ~= ""
insert concat_parts, repr(string_buffer)