mirror of
https://github.com/leafo/moonscript.git
synced 2024-11-22 02:44:23 +00:00
fix regression from #200
This commit is contained in:
parent
ce396acb15
commit
c24acf490b
@ -171,7 +171,7 @@ local build_grammar = wrap_env(debug_grammar, function(root)
|
||||
Slice = symx("[") * (SliceValue + Cc(1)) * sym(",") * (SliceValue + Cc("")) * (sym(",") * SliceValue) ^ -1 * sym("]") / mark("slice"),
|
||||
ColonCall = symx("\\") * (_Name * Invoke) / mark("colon"),
|
||||
ColonSuffix = symx("\\") * _Name / mark("colon_stub"),
|
||||
Invoke = FnArgs / mark("call") + SingleString / wrap_func_arg + DoubleString / wrap_func_arg + LuaString / wrap_func_arg,
|
||||
Invoke = FnArgs / mark("call") + SingleString / wrap_func_arg + DoubleString / wrap_func_arg + #P("[") * LuaString / wrap_func_arg,
|
||||
TableValue = KeyValue + Ct(Exp),
|
||||
TableLit = sym("{") * Ct(TableValueList ^ -1 * sym(",") ^ -1 * (SpaceBreak * TableLitLine * (sym(",") ^ -1 * SpaceBreak * TableLitLine) ^ 0 * sym(",") ^ -1) ^ -1) * White * sym("}") / mark("table"),
|
||||
TableValueList = TableValue * (sym(",") * TableValue) ^ 0,
|
||||
|
@ -261,7 +261,7 @@ build_grammar = wrap_env debug_grammar, (root) ->
|
||||
Invoke: FnArgs/mark"call" +
|
||||
SingleString / wrap_func_arg +
|
||||
DoubleString / wrap_func_arg +
|
||||
LuaString / wrap_func_arg
|
||||
#P"[" * LuaString / wrap_func_arg
|
||||
|
||||
TableValue: KeyValue + Ct(Exp)
|
||||
|
||||
|
@ -109,7 +109,7 @@ format_single_assign = (lhs, assign) ->
|
||||
|
||||
-- a symbol
|
||||
sym = (chars) -> Space * chars
|
||||
-- a symbole that doesn't accept whitespace before it
|
||||
-- a symbol that doesn't accept whitespace before it
|
||||
symx = (chars) -> chars
|
||||
|
||||
-- a constructor for quote delimited strings
|
||||
|
@ -69,6 +69,15 @@ something"else"
|
||||
something[[hey]] * 2
|
||||
something[======[hey]======] * 2
|
||||
|
||||
|
||||
something'else', 2
|
||||
something"else", 2
|
||||
something[[else]], 2
|
||||
|
||||
something 'else', 2
|
||||
something "else", 2
|
||||
something [[else]], 2
|
||||
|
||||
here(we)"go"[12123]
|
||||
|
||||
-- this runs
|
||||
|
@ -55,6 +55,12 @@ something('else')
|
||||
something("else")
|
||||
_ = something([[hey]]) * 2
|
||||
_ = something([======[hey]======]) * 2
|
||||
_ = something('else'), 2
|
||||
_ = something("else"), 2
|
||||
_ = something([[else]]), 2
|
||||
something('else', 2)
|
||||
something("else", 2)
|
||||
something([[else]], 2)
|
||||
_ = here(we)("go")[12123]
|
||||
local something = {
|
||||
test = 12323,
|
||||
|
Loading…
Reference in New Issue
Block a user