Rename module to "compiler-in-go"
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
This commit is contained in:
parent
0acd1d41e8
commit
9c32fe1d31
29 changed files with 38 additions and 38 deletions
|
|
@ -5,7 +5,7 @@ import (
|
|||
"os"
|
||||
"os/user"
|
||||
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/repl"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/repl"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
|||
2
go.mod
2
go.mod
|
|
@ -1,3 +1,3 @@
|
|||
module code.jmug.me/jmug/interpreter-in-go
|
||||
module code.jmug.me/jmug/compiler-in-go
|
||||
|
||||
go 1.23.3
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import (
|
|||
"bytes"
|
||||
"strings"
|
||||
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||
)
|
||||
|
||||
type ArrayLiteral struct {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package ast
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||
)
|
||||
|
||||
func TestString(t *testing.T) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package ast
|
|||
import (
|
||||
"bytes"
|
||||
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||
)
|
||||
|
||||
type BlockStatement struct {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package ast
|
||||
|
||||
import "code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
||||
import "code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||
|
||||
type Boolean struct {
|
||||
Token token.Token
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import (
|
|||
"bytes"
|
||||
"strings"
|
||||
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||
)
|
||||
|
||||
type CallExpression struct {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package ast
|
||||
|
||||
import "code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
||||
import "code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||
|
||||
// ExpressionStatement is a simple wrapper of an expression in a statement
|
||||
// This is common in scripting languages and allows you to have a source line
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import (
|
|||
"bytes"
|
||||
"strings"
|
||||
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||
)
|
||||
|
||||
type FunctionLiteral struct {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package ast
|
|||
import (
|
||||
"strings"
|
||||
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||
)
|
||||
|
||||
type HashLiteral struct {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package ast
|
||||
|
||||
import "code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
||||
import "code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||
|
||||
// Identifier is treated as an expression because in certain
|
||||
// circumstances they can return values (think `let some = other` where `other`
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package ast
|
|||
import (
|
||||
"bytes"
|
||||
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||
)
|
||||
|
||||
type IfExpression struct {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package ast
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||
)
|
||||
|
||||
type IndexExpression struct {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package ast
|
||||
|
||||
import "code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
||||
import "code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||
|
||||
type InfixExpression struct {
|
||||
Token token.Token // The operator token
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package ast
|
||||
|
||||
import "code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
||||
import "code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||
|
||||
type IntegerLiteral struct {
|
||||
Token token.Token
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package ast
|
|||
import (
|
||||
"bytes"
|
||||
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||
)
|
||||
|
||||
type LetStatement struct {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package ast
|
||||
|
||||
import "code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
||||
import "code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||
|
||||
type PrefixExpression struct {
|
||||
Token token.Token // The operator token
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package ast
|
|||
import (
|
||||
"bytes"
|
||||
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||
)
|
||||
|
||||
type ReturnStatement struct {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package ast
|
||||
|
||||
import "code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
||||
import "code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||
|
||||
type StringLiteral struct {
|
||||
Token token.Token
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"os"
|
||||
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/object"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/object"
|
||||
)
|
||||
|
||||
var builtins = map[string]*object.Builtin{
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ package evaluator
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/ast"
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/object"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/ast"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/object"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ package evaluator
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/lexer"
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/object"
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/parser"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/lexer"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/object"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/parser"
|
||||
)
|
||||
|
||||
func TestEvalIntegerExpression(t *testing.T) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package lexer
|
||||
|
||||
import "code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
||||
import "code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||
|
||||
type Lexer struct {
|
||||
input string
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package lexer
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||
)
|
||||
|
||||
func TestNextToken(t *testing.T) {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"strings"
|
||||
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/ast"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/ast"
|
||||
)
|
||||
|
||||
type ObjectType string
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ import (
|
|||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/ast"
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/lexer"
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/ast"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/lexer"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||
)
|
||||
|
||||
type (
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/ast"
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/lexer"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/ast"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/lexer"
|
||||
)
|
||||
|
||||
func TestLetStatements(t *testing.T) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package parser
|
||||
|
||||
import (
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ import (
|
|||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/evaluator"
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/lexer"
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/object"
|
||||
"code.jmug.me/jmug/interpreter-in-go/pkg/parser"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/evaluator"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/lexer"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/object"
|
||||
"code.jmug.me/jmug/compiler-in-go/pkg/parser"
|
||||
)
|
||||
|
||||
const PROMPT = ">> "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue