mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2025-01-22 21:35:29 +00:00
Fixed parse problem with PARAMETERS and ARGUMENTS.
This commit is contained in:
parent
2b734978d1
commit
5d5468857b
@ -13,9 +13,9 @@ static auto g_grammar = R"(
|
|||||||
WHILE <- 'while' _ EXPRESSION BLOCK
|
WHILE <- 'while' _ EXPRESSION BLOCK
|
||||||
IF <- 'if' _ EXPRESSION BLOCK ('else' _ 'if' _ EXPRESSION BLOCK)* ('else' _ BLOCK)?
|
IF <- 'if' _ EXPRESSION BLOCK ('else' _ 'if' _ EXPRESSION BLOCK)* ('else' _ BLOCK)?
|
||||||
FUNCTION <- 'fn' _ PARAMETERS BLOCK
|
FUNCTION <- 'fn' _ PARAMETERS BLOCK
|
||||||
PARAMETERS <- '(' _ IDENTIFIER* ')' _
|
PARAMETERS <- '(' _ (IDENTIFIER (',' _ IDENTIFIER)*)? ')' _
|
||||||
FUNCTION_CALL <- IDENTIFIER ARGUMENTS
|
FUNCTION_CALL <- IDENTIFIER ARGUMENTS
|
||||||
ARGUMENTS <- '(' _ EXPRESSION* ')' _
|
ARGUMENTS <- '(' _ (EXPRESSION (', ' _ EXPRESSION)*)? ')' _
|
||||||
|
|
||||||
PRIMARY <- CONDITION (CONDITION_OPERATOR CONDITION)?
|
PRIMARY <- CONDITION (CONDITION_OPERATOR CONDITION)?
|
||||||
CONDITION <- TERM (TERM_OPERATOR TERM)*
|
CONDITION <- TERM (TERM_OPERATOR TERM)*
|
||||||
|
Loading…
Reference in New Issue
Block a user