diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-13 09:56:12 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-13 09:56:38 -0700 |
| commit | 84c0058e69a18d5aec0ca4641725e87eddf4362f (patch) | |
| tree | 635f2f30d1afa98eef4d4e2a9ad29d2fa4fc8d41 /parser.moon | |
| parent | 295a25a3ed1d9012bf4fc018478afb56d94c30d1 (diff) | |
Switching to use 'unpack' for indentation grouping.
Diffstat (limited to 'parser.moon')
| -rw-r--r-- | parser.moon | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/parser.moon b/parser.moon index 1591161..78aa042 100644 --- a/parser.moon +++ b/parser.moon @@ -14,6 +14,7 @@ NOMSU_DEFS = with {} .nl = P("\r")^-1 * P("\n") .ws = S(" \t") .tonumber = tonumber + .unpack = unpack or table.unpack string_escapes = n:"\n", t:"\t", b:"\b", a:"\a", v:"\v", f:"\f", r:"\r" digit, hex = R('09'), R('09','af','AF') .escaped_char = (P("\\")*S("xX")*C(hex*hex)) / => string.char(tonumber(@, 16)) @@ -58,17 +59,6 @@ setmetatable(NOMSU_DEFS, {__index:(key)=> if userdata.source with userdata.source value.source = Source(.filename, .start + start-1, .start + stop-1) - while true - found = false - for i=#value,1,-1 - continue unless type(value[i]) == 'table' - if value[i].is_halfblock - found = true - hb = remove(value, i) - for v in *hb - insert value, i, v - i += 1 - break unless found comments = {} for i=#value,1,-1 continue unless type(value[i]) == 'table' |
