Step 337: Preprocessor AST Nodes (12/12 tests)
Added IncludeDirective, PragmaDirective, MacroDefinition as first-class AST nodes. Full serialization roundtrip and CompactAST support. Preprocessor directives are statement-level nodes with macro bodies kept as unparsed text. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -424,6 +424,13 @@ inline std::string getNodeName(const ASTNode* node) {
|
||||
return static_cast<const ModuleLoad*>(node)->moduleName;
|
||||
if (ct == "ScheduleTask")
|
||||
return static_cast<const ScheduleTask*>(node)->queue;
|
||||
// Preprocessor nodes (Step 337)
|
||||
if (ct == "IncludeDirective")
|
||||
return static_cast<const IncludeDirective*>(node)->path;
|
||||
if (ct == "PragmaDirective")
|
||||
return static_cast<const PragmaDirective*>(node)->directive;
|
||||
if (ct == "MacroDefinition")
|
||||
return static_cast<const MacroDefinition*>(node)->name;
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user