Started chapter 5 on Bytecode

main
oabrivard 2 years ago
parent 0b2d566e92
commit 493b0ff282

@ -2,8 +2,9 @@ package ast
import ( import (
"bytes" "bytes"
"monkey/token"
"strings" "strings"
"gitea.paas.celticinfo.fr/oabrivard/monkeylang/monkey4/token"
) )
// The base Node interface // The base Node interface

@ -1,8 +1,9 @@
package ast package ast
import ( import (
"monkey/token"
"testing" "testing"
"gitea.paas.celticinfo.fr/oabrivard/monkeylang/monkey4/token"
) )
func TestString(t *testing.T) { func TestString(t *testing.T) {

@ -2,7 +2,8 @@ package evaluator
import ( import (
"fmt" "fmt"
"monkey/object"
"gitea.paas.celticinfo.fr/oabrivard/monkeylang/monkey4/object"
) )
var builtins = map[string]*object.Builtin{ var builtins = map[string]*object.Builtin{

@ -2,8 +2,9 @@ package evaluator
import ( import (
"fmt" "fmt"
"monkey/ast"
"monkey/object" "gitea.paas.celticinfo.fr/oabrivard/monkeylang/monkey4/ast"
"gitea.paas.celticinfo.fr/oabrivard/monkeylang/monkey4/object"
) )
var ( var (

@ -1,10 +1,11 @@
package evaluator package evaluator
import ( import (
"monkey/lexer"
"monkey/object"
"monkey/parser"
"testing" "testing"
"gitea.paas.celticinfo.fr/oabrivard/monkeylang/monkey4/lexer"
"gitea.paas.celticinfo.fr/oabrivard/monkeylang/monkey4/object"
"gitea.paas.celticinfo.fr/oabrivard/monkeylang/monkey4/parser"
) )
func TestEvalIntegerExpression(t *testing.T) { func TestEvalIntegerExpression(t *testing.T) {

@ -1,3 +1,3 @@
module monkey module gitea.paas.celticinfo.fr/oabrivard/monkeylang/monkey4
go 1.14 go 1.14

@ -1,6 +1,6 @@
package lexer package lexer
import "monkey/token" import "gitea.paas.celticinfo.fr/oabrivard/monkeylang/monkey4/token"
type Lexer struct { type Lexer struct {
input string input string

@ -3,7 +3,7 @@ package lexer
import ( import (
"testing" "testing"
"monkey/token" "gitea.paas.celticinfo.fr/oabrivard/monkeylang/monkey4/token"
) )
func TestNextToken(t *testing.T) { func TestNextToken(t *testing.T) {

@ -2,9 +2,10 @@ package main
import ( import (
"fmt" "fmt"
"monkey/repl"
"os" "os"
"os/user" "os/user"
"gitea.paas.celticinfo.fr/oabrivard/monkeylang/monkey4/repl"
) )
func main() { func main() {

@ -4,8 +4,9 @@ import (
"bytes" "bytes"
"fmt" "fmt"
"hash/fnv" "hash/fnv"
"monkey/ast"
"strings" "strings"
"gitea.paas.celticinfo.fr/oabrivard/monkeylang/monkey4/ast"
) )
type BuiltinFunction func(args ...Object) Object type BuiltinFunction func(args ...Object) Object

@ -2,10 +2,11 @@ package parser
import ( import (
"fmt" "fmt"
"monkey/ast"
"monkey/lexer"
"monkey/token"
"strconv" "strconv"
"gitea.paas.celticinfo.fr/oabrivard/monkeylang/monkey4/ast"
"gitea.paas.celticinfo.fr/oabrivard/monkeylang/monkey4/lexer"
"gitea.paas.celticinfo.fr/oabrivard/monkeylang/monkey4/token"
) )
const ( const (

@ -2,9 +2,10 @@ package parser
import ( import (
"fmt" "fmt"
"monkey/ast"
"monkey/lexer"
"testing" "testing"
"gitea.paas.celticinfo.fr/oabrivard/monkeylang/monkey4/ast"
"gitea.paas.celticinfo.fr/oabrivard/monkeylang/monkey4/lexer"
) )
func TestLetStatements(t *testing.T) { func TestLetStatements(t *testing.T) {

@ -4,10 +4,11 @@ import (
"bufio" "bufio"
"fmt" "fmt"
"io" "io"
"monkey/evaluator"
"monkey/lexer" "gitea.paas.celticinfo.fr/oabrivard/monkeylang/monkey4/evaluator"
"monkey/object" "gitea.paas.celticinfo.fr/oabrivard/monkeylang/monkey4/lexer"
"monkey/parser" "gitea.paas.celticinfo.fr/oabrivard/monkeylang/monkey4/object"
"gitea.paas.celticinfo.fr/oabrivard/monkeylang/monkey4/parser"
) )
const PROMPT = ">> " const PROMPT = ">> "

Loading…
Cancel
Save