From ba853b24b1917ff4f2251977be3b222dbe8d6618 Mon Sep 17 00:00:00 2001 From: Hazem Krimi Date: Tue, 21 Apr 2026 01:34:51 +0100 Subject: [PATCH] chore: rename parser to compilation engine --- .../compilation-engine.go} | 0 main.go | 9 +++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) rename internal/{parser/parser.go => compilation-engine/compilation-engine.go} (100%) diff --git a/internal/parser/parser.go b/internal/compilation-engine/compilation-engine.go similarity index 100% rename from internal/parser/parser.go rename to internal/compilation-engine/compilation-engine.go diff --git a/main.go b/main.go index 849c342..9f3b95b 100644 --- a/main.go +++ b/main.go @@ -8,7 +8,7 @@ import ( "regexp" "strings" - "github.com/hazemKrimi/jack-compiler/internal/parser" + "github.com/hazemKrimi/jack-compiler/internal/compilation-engine" "github.com/hazemKrimi/jack-compiler/internal/tokenizer" ) @@ -26,7 +26,12 @@ func process(inputPath string) error { return err } - parsed := parser.ParseTokens(tokens) + parsed, err := parser.ParseTokens(tokens) + + if err != nil { + return err + } + outputPath := strings.Replace(inputPath, ".jack", ".xml", 1) if err := os.WriteFile(outputPath, []byte(parsed), 0644); err != nil {