changed the macro args to start from 0

This commit is contained in:
igor
2026-02-18 09:45:13 +01:00
parent 9732f0e74a
commit 28bc0e3842
3 changed files with 6 additions and 6 deletions

View File

@@ -786,7 +786,7 @@ class Parser:
replaced: List[str] = []
for lex in word.macro_expansion or []:
if lex.startswith("$"):
idx = int(lex[1:]) - 1
idx = int(lex[1:])
if idx < 0 or idx >= len(args):
raise ParseError(f"macro {word.name} missing argument for {lex}")
replaced.append(args[idx])