Start work on c++ fixture grammar
This commit is contained in:
parent
9959fe35b0
commit
3d0253f9b8
5 changed files with 7373 additions and 86 deletions
55
spec/fixtures/corpus/cpp/statements.txt
vendored
Normal file
55
spec/fixtures/corpus/cpp/statements.txt
vendored
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
==================================================
|
||||
simple functions cpp
|
||||
==================================================
|
||||
|
||||
int main() {
|
||||
x;
|
||||
}
|
||||
|
||||
---
|
||||
|
||||
(translation_unit (function_definition
|
||||
(type_specifier (identifier))
|
||||
(declarator (direct_declarator (direct_declarator (identifier))))
|
||||
(function_body (compound_statement
|
||||
(expression_statement (identifier))))))
|
||||
|
||||
==================================================
|
||||
function calls
|
||||
==================================================
|
||||
|
||||
int main() {
|
||||
printf("hello %s", "world");
|
||||
}
|
||||
|
||||
---
|
||||
|
||||
(translation_unit (function_definition
|
||||
(type_specifier (identifier))
|
||||
(declarator (direct_declarator (direct_declarator (identifier))))
|
||||
(function_body (compound_statement
|
||||
(expression_statement (call_expression (identifier) (string) (string)))))))
|
||||
|
||||
==================================================
|
||||
template / relational expression ambiguities
|
||||
==================================================
|
||||
|
||||
int main() {
|
||||
someVariable < someValue > 0.0;
|
||||
someTemplate<SomeType>(y);
|
||||
}
|
||||
|
||||
---
|
||||
|
||||
(translation_unit (function_definition
|
||||
(type_specifier (identifier))
|
||||
(declarator (direct_declarator (direct_declarator (identifier))))
|
||||
(function_body (compound_statement
|
||||
(expression_statement
|
||||
(relational_expression
|
||||
(relational_expression (identifier) (identifier))
|
||||
(number)))
|
||||
(expression_statement
|
||||
(call_expression
|
||||
(template_call (identifier) (type_id (type_specifier (identifier))))
|
||||
(identifier)))))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue