Replies: 1 comment 1 reply
-
Hey thanks for this observation. I would like to see some C++ experts to chime in and give feedback. Meanwhile I will research this myself to understand what the 'reasonable' expected behavior is. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I’m using the C++ grammar with Tree-sitter to parse imports. I noticed two cases where imports seem to be missed:
Conditional includes:
When a #include is nested inside #if or #ifdef, the node type is preproc_if / preproc_ifdef with preproc_include inside it. Currently, only top-level preproc_include is handled, so these conditionally compiled includes are skipped.
C++20 header-unit imports:
Statements like import ; are parsed as an expression_statement containing a template_function.
Is this expected behavior ?
Or should we adjust our import traversal logic (e.g., descend into preproc_if and expression_statement) to catch these?
Beta Was this translation helpful? Give feedback.
All reactions