Macro expander integrated in binder

This commit is contained in:
Michael Schimmel
2025-10-05 15:02:45 +02:00
parent 0d73a13051
commit 0edb9b800b
6 changed files with 27 additions and 17 deletions
+5 -1
View File
@@ -403,7 +403,11 @@ begin
var macroName := IIdentifierNode(tailNodes[0]);
var macroParams := elements[2].Params;
var macroBody := tailNodes[2];
if tailTokens[2].Kind <> tkQuote then
raise Exception.Create('Syntax Error: Expected a quasiquote as macro body.');
var macroBody := IQuasiQuoteNode(tailNodes[2]);
Result := TAst.MacroDef(macroName, macroParams, macroBody);
end