aboutsummaryrefslogtreecommitdiff
path: root/nomsu.moon
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-01-11 01:19:03 -0800
committerBruce Hill <bitbucket@bruce-hill.com>2018-01-11 01:19:03 -0800
commit82cc997ddf3712a1d36521ba6128ec4858a8f405 (patch)
tree046f7aa7c22620b6da1310c828d0d63a998052ab /nomsu.moon
parent6f4b67632a544780438110bb11e5122448e24881 (diff)
Renamed rule % = % to action % %
Diffstat (limited to 'nomsu.moon')
-rwxr-xr-xnomsu.moon8
1 files changed, 4 insertions, 4 deletions
diff --git a/nomsu.moon b/nomsu.moon
index 6da2411..f9c2800 100755
--- a/nomsu.moon
+++ b/nomsu.moon
@@ -36,7 +36,7 @@ if _VERSION == "Lua 5.1"
-- type checking?
-- Fix compiler bug that breaks when file ends with a block comment
-- Add compiler options for optimization level (compile-fast vs. run-fast, etc.)
--- Do a pass on all rules to enforce parameters-are-nouns heuristic
+-- Do a pass on all actions to enforce parameters-are-nouns heuristic
lpeg.setmaxstack 10000 -- whoa
{:P,:R,:V,:S,:Cg,:C,:Cp,:B,:Cmt} = lpeg
@@ -185,7 +185,7 @@ class NomsuCompiler
stub, arg_names, escaped_args = unpack(signature[sig_i])
arg_positions = {}
@assert stub, "NO STUB FOUND: #{repr signature}"
- if @debug then @writeln "#{colored.bright "DEFINING RULE:"} #{colored.underscore colored.magenta repr(stub)} #{colored.bright "WITH ARGS"} #{colored.dim repr(arg_names)}"
+ if @debug then @writeln "#{colored.bright "DEFINING ACTION:"} #{colored.underscore colored.magenta repr(stub)} #{colored.bright "WITH ARGS"} #{colored.dim repr(arg_names)}"
for i=1,#arg_names-1 do for j=i+1,#arg_names
if arg_names[i] == arg_names[j] then @error "Duplicate argument in function #{stub}: '#{arg_names[i]}'"
@@ -555,7 +555,7 @@ end]]\format(lua_code))
elseif not def and @@math_patt\match(tree.stub)
-- This is a bit of a hack, but this code handles arbitrarily complex
-- math expressions like 2*x + 3^2 without having to define a single
- -- rule for every possibility.
+ -- action for every possibility.
bits = {}
for tok in *tree.value
if tok.type == "Word"
@@ -735,7 +735,7 @@ end]]\format(lua_code))
if not x
@error "Nothing to get stub from"
-- Returns a single stub ("say %"), list of arg names ({"msg"}), and set of arg
- -- names that should not be evaluated from a single rule def
+ -- names that should not be evaluated from a single action def
-- (e.g. "say %msg") or function call (e.g. FunctionCall({Word("say"), Var("msg")))
if type(x) == 'string'
-- Standardize format to stuff separated by spaces