From 795c99d2727cca3c9370f385155230d8f1da61f7 Mon Sep 17 00:00:00 2001 From: Shubham raj Date: Tue, 23 Sep 2025 22:14:31 +0530 Subject: [PATCH 1/4] chore: Add Build workflow --- .github/workflows/go.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..6821ca9 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,25 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: Go + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.20' + + - name: Build + run: go build -v ./... From 59b9a4cddad966618eed03637a67bf8e1ee9e511 Mon Sep 17 00:00:00 2001 From: shubham Date: Tue, 23 Sep 2025 22:16:26 +0530 Subject: [PATCH 2/4] chore: update the go verison in build --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 6821ca9..e056c1c 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: '1.20' + go-version: '1.25.1' - name: Build run: go build -v ./... From f03e8585cab4106eb5c0cff720ea9d51743e7616 Mon Sep 17 00:00:00 2001 From: shubham Date: Tue, 23 Sep 2025 22:19:02 +0530 Subject: [PATCH 3/4] fix: go build command --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index e056c1c..1edf977 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -22,4 +22,4 @@ jobs: go-version: '1.25.1' - name: Build - run: go build -v ./... + run: go build . From 95c31085d6f4e800df75b8a24cfd88ffd72016a0 Mon Sep 17 00:00:00 2001 From: shubham Date: Tue, 23 Sep 2025 22:23:05 +0530 Subject: [PATCH 4/4] refactor: rename token package to Token for consistency across imports --- Interpreter/interpreter.go | 2 +- Lox.go | 2 +- LoxErrors/loxError.go | 2 +- Scanner/scanner.go | 2 +- ast/Expr.go | 2 +- ast/stmt.go | 2 +- environment/environmnent.go | 2 +- parser/parser.go | 2 +- printer/generateAst.go | 4 ++-- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Interpreter/interpreter.go b/Interpreter/interpreter.go index cb04dac..123f96b 100644 --- a/Interpreter/interpreter.go +++ b/Interpreter/interpreter.go @@ -7,7 +7,7 @@ import ( "github.com/shubhdevelop/Lox/LoxErrors" "github.com/shubhdevelop/Lox/ast" "github.com/shubhdevelop/Lox/environment" - "github.com/shubhdevelop/Lox/token" + "github.com/shubhdevelop/Lox/Token" ) type Interpreter struct{} diff --git a/Lox.go b/Lox.go index 9e4e1f0..8cc3d65 100644 --- a/Lox.go +++ b/Lox.go @@ -8,7 +8,7 @@ import ( interpreter "github.com/shubhdevelop/Lox/Interpreter" "github.com/shubhdevelop/Lox/parser" - "github.com/shubhdevelop/Lox/scanner" + "github.com/shubhdevelop/Lox/Scanner" "github.com/shubhdevelop/Lox/state" ) diff --git a/LoxErrors/loxError.go b/LoxErrors/loxError.go index 5358457..d921a33 100644 --- a/LoxErrors/loxError.go +++ b/LoxErrors/loxError.go @@ -5,7 +5,7 @@ import ( "os" "github.com/shubhdevelop/Lox/state" - "github.com/shubhdevelop/Lox/token" + "github.com/shubhdevelop/Lox/Token" ) type RuntimeError struct { diff --git a/Scanner/scanner.go b/Scanner/scanner.go index 9b378b8..5cc3f72 100644 --- a/Scanner/scanner.go +++ b/Scanner/scanner.go @@ -3,7 +3,7 @@ package scanner import ( "errors" "github.com/shubhdevelop/Lox/LoxErrors" - "github.com/shubhdevelop/Lox/token" + "github.com/shubhdevelop/Lox/Token" "strconv" ) diff --git a/ast/Expr.go b/ast/Expr.go index d91d047..76b7f0a 100644 --- a/ast/Expr.go +++ b/ast/Expr.go @@ -1,7 +1,7 @@ package ast import ( - "github.com/shubhdevelop/Lox/token" + "github.com/shubhdevelop/Lox/Token" ) type ExprVisitor interface { diff --git a/ast/stmt.go b/ast/stmt.go index 83bb5a2..b8f47b2 100644 --- a/ast/stmt.go +++ b/ast/stmt.go @@ -1,7 +1,7 @@ package ast import ( - "github.com/shubhdevelop/Lox/token" + "github.com/shubhdevelop/Lox/Token" ) type StmtVisitor interface { diff --git a/environment/environmnent.go b/environment/environmnent.go index e55fcbb..7adbe68 100644 --- a/environment/environmnent.go +++ b/environment/environmnent.go @@ -3,7 +3,7 @@ package environment import ( "fmt" loxErrors "github.com/shubhdevelop/Lox/LoxErrors" - "github.com/shubhdevelop/Lox/token" + "github.com/shubhdevelop/Lox/Token" ) type Environment struct { diff --git a/parser/parser.go b/parser/parser.go index 1236fd5..20ee57c 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -5,7 +5,7 @@ import ( "github.com/shubhdevelop/Lox/LoxErrors" "github.com/shubhdevelop/Lox/ast" - "github.com/shubhdevelop/Lox/token" + "github.com/shubhdevelop/Lox/Token" ) type Parser struct { diff --git a/printer/generateAst.go b/printer/generateAst.go index a877841..72d0db0 100644 --- a/printer/generateAst.go +++ b/printer/generateAst.go @@ -113,11 +113,11 @@ func main() { "Literal : interface{} value", "Unary : token.Token operator, Expr right", "Variable : token.Token name", - }, []string{"github.com/shubhdevelop/Lox/token"}) + }, []string{"github.com/shubhdevelop/Lox/Token"}) defineAst(outputDir, "Stmt", []string{ "ExpressionStmt : Expr expression", "PrintStmt : Expr expression", "Var : token.Token name, Expr initializer", - }, []string{"github.com/shubhdevelop/Lox/token"}) + }, []string{"github.com/shubhdevelop/Lox/Token"}) }