Details
- Reviewers
gribozavr2 - Commits
- rGba32915db2ce: [SyntaxTree] Add support for `MemberExpression`
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/include/clang/Tooling/Syntax/Nodes.h | ||
---|---|---|
333 | We could discuss how to model the implicit member expression, as it has a totally different syntax. | |
clang/unittests/Tooling/Syntax/BuildTreeTest.cpp | ||
1769–1771 | Not much progress trying to use other ignores. Perhaps we can treat this properly when adding support for CXXConstructExpr | |
2086–2087 | I'm experimenting with that now, but anyways, I think this should go to the patch,
|
clang/include/clang/Tooling/Syntax/Nodes.h | ||
---|---|---|
180 | Could you order new items in source order? object, access token, member. | |
333 | I think the syntax tree should represent only the syntax that was actually present in the source code. IOW, implicit member expression from Clang AST should not map to a member expression in the syntax tree. The syntax tree should represent just the id-expression. | |
clang/lib/Tooling/Syntax/BuildTree.cpp | ||
900 | Please make unqualifiedId variable start with the uppercase character. Since it would clash with the type name, you can do TheUnqualifiedId, for example. Same for idExpression below. | |
911 | This code seems largely identical to WalkUpFromDeclRefExpr. (It is also somewhat difficult to track what is happening because we are creating three levels of nodes here.) Could we factor out the repeated code? | |
clang/unittests/Tooling/Syntax/BuildTreeTest.cpp | ||
634–636 | ||
2085 | ||
2086–2087 | ||
2101 | ||
2133 | ||
2165 | Please add tests that access static members through member expression syntax. | |
2165 | Please add a test for variable templates: struct S { template<typename T> static constexpr T x = 42; }; void f(S s) { s.x<int>; } |
clang/lib/Tooling/Syntax/BuildTree.cpp | ||
---|---|---|
900 | I just saw in the style guide the rules for casing. I didn't expect this to exist because it doesn't seem to be obeyed ^^. For instance WalkUpFrom* starts with Upper-case. I'll follow-up with a patch fixing any style problems of this nature. | |
911 | I agree.
Taking into these variables we could write a function buildIdExpression
The first option takes into account only the differences that we perceived until now. |
Could you order new items in source order? object, access token, member.