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:
Bill
2026-02-16 00:36:25 -07:00
parent 2eef074fa1
commit 96799dd51f
6 changed files with 333 additions and 0 deletions

View File

@@ -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 "";
}