[PATCH] D85316: [SyntaxTree] Proposition of new tree dump

Eduardo Caldas via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 5 10:41:50 PDT 2020


eduucaldas updated this revision to Diff 283298.
eduucaldas added a comment.

Answering comments


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85316/new/

https://reviews.llvm.org/D85316

Files:
  clang/unittests/Tooling/Syntax/TreeTest.cpp


Index: clang/unittests/Tooling/Syntax/TreeTest.cpp
===================================================================
--- clang/unittests/Tooling/Syntax/TreeTest.cpp
+++ clang/unittests/Tooling/Syntax/TreeTest.cpp
@@ -308,45 +308,45 @@
 }
 )cpp",
       R"txt(
-*: TranslationUnit
+TranslationUnit Detached
 `-SimpleDeclaration
-  |-int
-  |-SimpleDeclarator
-  | |-main
+  |-'int'
+  |-SimpleDeclarator SimpleDeclaration_declarator
+  | |-'main'
   | `-ParametersAndQualifiers
-  |   |-(
-  |   `-)
+  |   |-'(' OpenParen
+  |   `-')' CloseParen
   `-CompoundStatement
-    |-{
-    |-IfStatement
-    | |-if
-    | |-(
+    |-'{' OpenParen
+    |-IfStatement CompoundStatement_statement
+    | |-'if' IntroducerKeyword
+    | |-'('
     | |-IntegerLiteralExpression
-    | | `-1
-    | |-)
-    | `-CompoundStatement
-    |   |-{
-    |   `-}
-    |-IfStatement
-    | |-if
-    | |-(
+    | | `-'1' LiteralToken
+    | |-')'
+    | `-CompoundStatement IfStatement_thenStatement
+    |   |-'{' OpenParen
+    |   `-'}' CloseParen
+    |-IfStatement CompoundStatement_statement
+    | |-'if' IntroducerKeyword
+    | |-'('
     | |-IntegerLiteralExpression
-    | | `-1
-    | |-)
-    | |-CompoundStatement
-    | | |-{
-    | | `-}
-    | |-else
-    | `-IfStatement
-    |   |-if
-    |   |-(
+    | | `-'1' LiteralToken
+    | |-')'
+    | |-CompoundStatement IfStatement_thenStatement
+    | | |-'{' OpenParen
+    | | `-'}' CloseParen
+    | |-'else' IfStatement_elseKeyword
+    | `-IfStatement IfStatement_elseStatement
+    |   |-'if' IntroducerKeyword
+    |   |-'('
     |   |-IntegerLiteralExpression
-    |   | `-0
-    |   |-)
-    |   `-CompoundStatement
-    |     |-{
-    |     `-}
-    `-}
+    |   | `-'0' LiteralToken
+    |   |-')'
+    |   `-CompoundStatement IfStatement_thenStatement
+    |     |-'{' OpenParen
+    |     `-'}' CloseParen
+    `-'}' CloseParen
 )txt"));
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85316.283298.patch
Type: text/x-patch
Size: 1903 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200805/a3347d3f/attachment.bin>


More information about the cfe-commits mailing list