From 92507b15ccb38eb989b57e7e8f866d82b5b42cbe Mon Sep 17 00:00:00 2001 From: Suleyman Farajli Date: Sun, 5 Jan 2025 01:31:28 +0400 Subject: preprocessor skips and doesn't tread include file names as strings --- src/main.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main.go') diff --git a/src/main.go b/src/main.go index a654276..5962ef5 100644 --- a/src/main.go +++ b/src/main.go @@ -120,6 +120,7 @@ func preprocess(rawTokens[] Token) []Token { } tmp := rawTokens[i + 1].str + i++ 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++ @@ -602,6 +603,7 @@ func main() { } tokens := tokenize(argv[argc - 1]) tokens = preprocess(tokens) + fmt.Println(tokens) ops := parse(tokens) /* FIXME: check for error */ w := bufio.NewWriter(file) -- cgit v1.2.3