mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
LibCpp: Add test for parsing class definitions
This commit is contained in:
parent
7de6c1489b
commit
ee9fe288b2
2 changed files with 38 additions and 0 deletions
27
Userland/Libraries/LibCpp/Tests/class.ast
Normal file
27
Userland/Libraries/LibCpp/Tests/class.ast
Normal file
|
@ -0,0 +1,27 @@
|
|||
TranslationUnit[0:0->10:1]
|
||||
StructOrClassDeclaration[0:6->10:1]
|
||||
A
|
||||
C'tor
|
||||
(
|
||||
Parameter[1:6->1:10]
|
||||
z
|
||||
Type[1:6->1:10]
|
||||
int
|
||||
)
|
||||
D'tor
|
||||
(
|
||||
)
|
||||
FunctionDeclaration[3:4->3:14]
|
||||
Type[3:4->3:9]
|
||||
void
|
||||
foo
|
||||
(
|
||||
)
|
||||
VariableDeclaration[6:4->8:0]
|
||||
Type[6:4->6:8]
|
||||
int
|
||||
x
|
||||
VariableDeclaration[9:4->10:0]
|
||||
Type[9:4->9:8]
|
||||
int
|
||||
y
|
11
Userland/Libraries/LibCpp/Tests/class.cpp
Normal file
11
Userland/Libraries/LibCpp/Tests/class.cpp
Normal file
|
@ -0,0 +1,11 @@
|
|||
class A {
|
||||
A(int z);
|
||||
~A();
|
||||
void foo();
|
||||
|
||||
private:
|
||||
int x;
|
||||
|
||||
public:
|
||||
int y;
|
||||
};
|
Loading…
Add table
Reference in a new issue