aboutsummaryrefslogtreecommitdiff
path: root/nomsu.moon
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2017-10-13 19:43:55 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2017-10-13 19:43:55 -0700
commit9dee9dbbd8708ac2fb00c2240c7e0059e8691eb2 (patch)
tree0021fa598c2f973ce119f5fb5b8b357c930cc735 /nomsu.moon
parentbccfe9d8e12ba024c745cd533f73987439c76499 (diff)
Made symbols group with each other, instead of *every* one being alone.
Diffstat (limited to 'nomsu.moon')
-rwxr-xr-xnomsu.moon6
1 files changed, 3 insertions, 3 deletions
diff --git a/nomsu.moon b/nomsu.moon
index 82867ed..a188d1b 100755
--- a/nomsu.moon
+++ b/nomsu.moon
@@ -102,7 +102,7 @@ nomsu = [=[
(expression (dotdot / tok_gap))* word ((dotdot / tok_gap) (expression / word))*
|} }) -> FunctionCall
- word <- ({ { %wordbreaker / (!number %wordchar+) } }) -> Word
+ word <- ({ { (%wordbreaker+) / (!number %wordchar+) } }) -> Word
inline_string <- ({ '"' {|
({~ (("\\" -> "\") / ('\"' -> '"') / ("\n" -> "
@@ -120,7 +120,7 @@ nomsu = [=[
-- Variables can be nameless (i.e. just %) and can't contain apostrophes
-- which is a hack to allow %foo's to parse as "%foo" and "'s" separately
- variable <- ({ ("%" { (%wordbreaker / (%wordchar+))? }) }) -> Var
+ variable <- ({ ("%" { ((%wordbreaker+) / (%wordchar+))? }) }) -> Var
inline_list <- ({ {|
("[" %ws? ((inline_list_item comma)* inline_list_item comma?)? %ws? "]")
@@ -542,7 +542,7 @@ end)]])\format(concat(lua_bits, "\n"))
-- Returns a single stub ("say %"), and list of arg names ({"msg"}) from a single rule def
-- (e.g. "say %msg") or function call (e.g. FunctionCall({Word("say"), Var("msg")))
if type(x) == 'string'
- stub = x\gsub("([#{wordbreaker}])"," %1 ")\gsub("%%%S+","%%")\gsub("%s+"," ")\gsub("%s*$","")
+ stub = x\gsub("([#{wordbreaker}]+)"," %1 ")\gsub("%%%S+","%%")\gsub("%s+"," ")\gsub("%s*$","")
arg_names = [arg for arg in x\gmatch("%%([^%s']*)")]
return stub, arg_names
switch x.type