aboutsummaryrefslogtreecommitdiff
path: root/MoonParser/moon_parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'MoonParser/moon_parser.cpp')
-rw-r--r--MoonParser/moon_parser.cpp28
1 files changed, 11 insertions, 17 deletions
diff --git a/MoonParser/moon_parser.cpp b/MoonParser/moon_parser.cpp
index ec8df38..8917e58 100644
--- a/MoonParser/moon_parser.cpp
+++ b/MoonParser/moon_parser.cpp
@@ -312,30 +312,24 @@ rule Parens = sym('(') >> *SpaceBreak >> Exp >> *SpaceBreak >> sym(')');
312rule Callable = Space >> Variable | SelfName | VarArg | Parens; 312rule Callable = Space >> Variable | SelfName | VarArg | Parens;
313rule FnArgsExpList = Exp >> *((Break | sym(',')) >> White >> Exp); 313rule FnArgsExpList = Exp >> *((Break | sym(',')) >> White >> Exp);
314 314
315rule FnArgs = Seperator >> 315rule FnArgs = (symx('(') >> *SpaceBreak >> -FnArgsExpList >> *SpaceBreak >> sym(')')) |
316( 316 (sym('!') >> not_(expr('=')));
317 (
318 symx('(') >> *SpaceBreak >> -FnArgsExpList >> *SpaceBreak >> sym(')')
319 ) | (
320 sym('!') >> not_(expr('='))
321 )
322);
323 317
324extern rule ChainItems, DotChainItem, ColonChain; 318extern rule ChainItems, DotChainItem, ColonChain;
325 319
326rule chain_call = (Callable | String) >> ChainItems; 320rule chain_call = (Callable | String) >> ChainItems;
327rule chain_item = not_(set(".\\")) >> ChainItems; 321rule chain_item = and_(set(".\\")) >> ChainItems;
328rule chain_dot_chain = DotChainItem >> -ChainItems; 322rule chain_dot_chain = DotChainItem >> -ChainItems;
329 323
330rule Chain = 324rule Chain = Seperator >> (
331 chain_call | 325 chain_call |
332 chain_item | 326 chain_item |
333 Space >> (chain_dot_chain | ColonChain); 327 Space >> (chain_dot_chain | ColonChain));
334 328
335extern rule ChainItem; 329extern rule ChainItem;
336 330
337rule chain_with_colon = +ChainItem >> -ColonChain; 331rule chain_with_colon = +ChainItem >> -ColonChain;
338rule ChainItems = Seperator >> (chain_with_colon | ColonChain); 332rule ChainItems = chain_with_colon | ColonChain;
339 333
340extern rule Invoke, Slice; 334extern rule Invoke, Slice;
341 335
@@ -355,11 +349,11 @@ rule Slice =
355 (sym(',') >> Exp | default_value) >> 349 (sym(',') >> Exp | default_value) >>
356 sym(']'); 350 sym(']');
357 351
358rule Invoke = 352rule Invoke = Seperator >> (
359 FnArgs | 353 FnArgs |
360 SingleString | 354 SingleString |
361 DoubleString | 355 DoubleString |
362 and_(expr('[')) >> LuaString; 356 and_(expr('[')) >> LuaString);
363 357
364extern rule TableValueList, TableLitLine; 358extern rule TableValueList, TableLitLine;
365 359
@@ -448,7 +442,7 @@ rule ExpList = Seperator >> Exp >> *(sym(',') >> Exp);
448rule ExpListLow = Seperator >> Exp >> *((sym(',') | sym(';')) >> Exp); 442rule ExpListLow = Seperator >> Exp >> *((sym(',') | sym(';')) >> Exp);
449 443
450rule ArgLine = CheckIndent >> Exp >> *(sym(',') >> Exp); 444rule ArgLine = CheckIndent >> Exp >> *(sym(',') >> Exp);
451rule ArgBlock = Seperator >> ArgLine >> *(sym(',') >> SpaceBreak >> ArgLine) >> PopIndent; 445rule ArgBlock = ArgLine >> *(sym(',') >> SpaceBreak >> ArgLine) >> PopIndent;
452 446
453rule invoke_args_with_table = 447rule invoke_args_with_table =
454 sym(',') >> 448 sym(',') >>
@@ -458,9 +452,9 @@ rule invoke_args_with_table =
458 ); 452 );
459 453
460rule InvokeArgs = 454rule InvokeArgs =
461 not_(expr('-')) >> 455 not_(expr('-')) >> Seperator >>
462 ( 456 (
463 ExpList >> -(invoke_args_with_table | TableBlock) | 457 Exp >> *(sym(',') >> Exp) >> -(invoke_args_with_table | TableBlock) |
464 TableBlock 458 TableBlock
465 ); 459 );
466 460