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"
|
||||||
"os/user"
|
"os/user"
|
||||||
|
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/repl"
|
"code.jmug.me/jmug/compiler-in-go/pkg/repl"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
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
|
go 1.23.3
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ArrayLiteral struct {
|
type ArrayLiteral struct {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package ast
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestString(t *testing.T) {
|
func TestString(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package ast
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
type BlockStatement struct {
|
type BlockStatement struct {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package ast
|
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 {
|
type Boolean struct {
|
||||||
Token token.Token
|
Token token.Token
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CallExpression struct {
|
type CallExpression struct {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package ast
|
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
|
// 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
|
// This is common in scripting languages and allows you to have a source line
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
type FunctionLiteral struct {
|
type FunctionLiteral struct {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package ast
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
type HashLiteral struct {
|
type HashLiteral struct {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package ast
|
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
|
// Identifier is treated as an expression because in certain
|
||||||
// circumstances they can return values (think `let some = other` where `other`
|
// circumstances they can return values (think `let some = other` where `other`
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package ast
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
type IfExpression struct {
|
type IfExpression struct {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package ast
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
type IndexExpression struct {
|
type IndexExpression struct {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package ast
|
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 {
|
type InfixExpression struct {
|
||||||
Token token.Token // The operator token
|
Token token.Token // The operator token
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package ast
|
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 {
|
type IntegerLiteral struct {
|
||||||
Token token.Token
|
Token token.Token
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package ast
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
type LetStatement struct {
|
type LetStatement struct {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package ast
|
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 {
|
type PrefixExpression struct {
|
||||||
Token token.Token // The operator token
|
Token token.Token // The operator token
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package ast
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ReturnStatement struct {
|
type ReturnStatement struct {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package ast
|
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 {
|
type StringLiteral struct {
|
||||||
Token token.Token
|
Token token.Token
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"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{
|
var builtins = map[string]*object.Builtin{
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ package evaluator
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/ast"
|
"code.jmug.me/jmug/compiler-in-go/pkg/ast"
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/object"
|
"code.jmug.me/jmug/compiler-in-go/pkg/object"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@ package evaluator
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/lexer"
|
"code.jmug.me/jmug/compiler-in-go/pkg/lexer"
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/object"
|
"code.jmug.me/jmug/compiler-in-go/pkg/object"
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/parser"
|
"code.jmug.me/jmug/compiler-in-go/pkg/parser"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestEvalIntegerExpression(t *testing.T) {
|
func TestEvalIntegerExpression(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package lexer
|
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 {
|
type Lexer struct {
|
||||||
input string
|
input string
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package lexer
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNextToken(t *testing.T) {
|
func TestNextToken(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/ast"
|
"code.jmug.me/jmug/compiler-in-go/pkg/ast"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ObjectType string
|
type ObjectType string
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/ast"
|
"code.jmug.me/jmug/compiler-in-go/pkg/ast"
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/lexer"
|
"code.jmug.me/jmug/compiler-in-go/pkg/lexer"
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/ast"
|
"code.jmug.me/jmug/compiler-in-go/pkg/ast"
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/lexer"
|
"code.jmug.me/jmug/compiler-in-go/pkg/lexer"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestLetStatements(t *testing.T) {
|
func TestLetStatements(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package parser
|
package parser
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/token"
|
"code.jmug.me/jmug/compiler-in-go/pkg/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,10 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/evaluator"
|
"code.jmug.me/jmug/compiler-in-go/pkg/evaluator"
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/lexer"
|
"code.jmug.me/jmug/compiler-in-go/pkg/lexer"
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/object"
|
"code.jmug.me/jmug/compiler-in-go/pkg/object"
|
||||||
"code.jmug.me/jmug/interpreter-in-go/pkg/parser"
|
"code.jmug.me/jmug/compiler-in-go/pkg/parser"
|
||||||
)
|
)
|
||||||
|
|
||||||
const PROMPT = ">> "
|
const PROMPT = ">> "
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue