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:
Will Hawkins
2026-04-20 02:25:28 -04:00
parent 23e0bf5de3
commit fa1f694d76
2 changed files with 37 additions and 2 deletions
+35
View File
@@ -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() {