grammar: Hide the return keyword in the grammar
And, add a grammar test for the return keyword. Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
@@ -1,4 +1,39 @@
|
||||
=========================
|
||||
Return Statement
|
||||
=========================
|
||||
int fun() {
|
||||
return 1;
|
||||
};
|
||||
---
|
||||
(p4program
|
||||
(declaration
|
||||
(function_declaration
|
||||
(typeRef
|
||||
(baseType
|
||||
(int)
|
||||
)
|
||||
)
|
||||
(identifier)
|
||||
(parameters)
|
||||
(statement
|
||||
(blockStatement
|
||||
(statements
|
||||
(statement
|
||||
(return_statement
|
||||
(expression
|
||||
(simple_expression
|
||||
(integer)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
=========================
|
||||
Simple If Statement (No Else)
|
||||
=========================
|
||||
parser simple() {
|
||||
|
||||
Reference in New Issue
Block a user