ladybird/Userland/Libraries/LibCpp/Tests/local-vars.ast
Itamar 832e9c6e02 LibCpp: Add regression tests for the parser
For each .cpp file in the test suite data, there is a .ast file that
represents the "known good" baseline of the parser result.

Each .cpp file goes through the parser, and the result of
invoking `ASTNode::dump()` on the root node is compared to the
baseline to find regressions.

We also check that there were no parser errors when parsing the .cpp
files.
2021-05-19 23:19:07 +02:00

33 lines
651 B
Text

TranslationUnit[1:0->7:0]
FunctionDeclaration[1:0->7:0]
Type[1:0->1:4]
int
foo
(
)
FunctionDefinition[2:0->7:0]
{
VariableDeclaration[3:4->3:9]
Type[3:4->3:8]
int
x
VariableDeclaration[4:4->4:16]
Type[4:4->4:11]
double
y
NumericLiteral[4:15->4:15]
2
VariableDeclaration[5:4->5:20]
Type[5:4->5:11]
double
z
BinaryExpression[5:15->5:20]
Name[5:15->5:17]
x
+
Name[5:19->5:20]
y
ReturnStatement[6:4->6:12]
Name[6:11->6:12]
z
}