From 68662b9b357e02ca7820a511a2616596f650c31b Mon Sep 17 00:00:00 2001 From: Suleyman Farajli Date: Sun, 5 Jan 2025 01:12:07 +0400 Subject: preprocessor: bug fix --- src/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.go b/src/main.go index 873f958..a654276 100644 --- a/src/main.go +++ b/src/main.go @@ -120,7 +120,7 @@ func preprocess(rawTokens[] Token) []Token { } tmp := rawTokens[i + 1].str - incFile := tmp[1:len(tmp) -1 ] /* get rid of the `"` at the beginning and at the end */ + incFile := tmp[1:len(tmp) - 1] /* get rid of the `"` at the beginning and at the end */ rawTokens = slices.Insert(rawTokens, i + 1, tokenize(incFile)...) incDepth++ continue @@ -136,6 +136,7 @@ func preprocess(rawTokens[] Token) []Token { if macros[y].name == tokens[i].str { tokens = append(tokens[:i], tokens[i + 1:]...) tokens = slices.Insert(tokens, i, macros[y].tokens...) + i-- } } } -- cgit v1.2.3