File tree 19 files changed +77
-34
lines changed
19 files changed +77
-34
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ // MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md013.md
3
+ "MD013" : false
4
+ }
Original file line number Diff line number Diff line change 1
- # monkey-interpreter
2
- The result of following Writing An Interpreter In Go by Thorsten Ball
1
+ # Monkey Language _ (monkey)_
2
+
3
+ A fully working interpreter for the [ Monkey programming language] ( https://interpreterbook.com/#the-monkey-programming-language ) .
4
+
5
+ This repository is the result of following the book [ Writing An Interpreter In Go] ( https://interpreterbook.com/ ) by Thorsten Ball and [ The Lost Chapter] ( https://interpreterbook.com/lost ) by the same author.
6
+ This will be continued with the book [ Writing A Compiler In Go] ( https://compilerbook.com/ ) .
7
+
8
+ ## Install
9
+
10
+ ``` shell
11
+ git clone https://github.com/SVendittelli/monkey.git
12
+ cd monkey
13
+ ```
14
+
15
+ ### Dependencies
16
+
17
+ - [ Go] ( https://go.dev/ ) >= 1.13.
18
+
19
+ ## Usage
20
+
21
+ To run the REPL:
22
+
23
+ ``` shell
24
+ go run main.go
25
+ ```
26
+
27
+ ## Maintainer
28
+
29
+ [ @SVendittelli ] ( https://github.com/SVendittelli ) .
30
+
31
+ ## Contributing
32
+
33
+ As this is a personal project for learning purposes, I am not accepting contributions at this time.
34
+
35
+ ## License
36
+
37
+ [ MIT © Sam Vendittelli.] ( ./LICENSE )
38
+
39
+ ``` yaml
40
+ SPDX-License-Identifier : MIT
41
+ ` ` `
Original file line number Diff line number Diff line change 4
4
"bytes"
5
5
"strings"
6
6
7
- "github.com/SVendittelli/monkey-interpreter /token"
7
+ "github.com/SVendittelli/monkey/token"
8
8
)
9
9
10
10
// The base Node interface
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ package ast
3
3
import (
4
4
"testing"
5
5
6
- "github.com/SVendittelli/monkey-interpreter /token"
6
+ "github.com/SVendittelli/monkey/token"
7
7
)
8
8
9
9
func TestString (t * testing.T ) {
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ package evaluator
3
3
import (
4
4
"fmt"
5
5
6
- "github.com/SVendittelli/monkey-interpreter /object"
6
+ "github.com/SVendittelli/monkey/object"
7
7
)
8
8
9
9
var builtins = map [string ]* object.Builtin {
Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ package evaluator
3
3
import (
4
4
"fmt"
5
5
6
- "github.com/SVendittelli/monkey-interpreter /ast"
7
- "github.com/SVendittelli/monkey-interpreter /object"
6
+ "github.com/SVendittelli/monkey/ast"
7
+ "github.com/SVendittelli/monkey/object"
8
8
)
9
9
10
10
var (
Original file line number Diff line number Diff line change @@ -3,9 +3,9 @@ package evaluator
3
3
import (
4
4
"testing"
5
5
6
- "github.com/SVendittelli/monkey-interpreter /lexer"
7
- "github.com/SVendittelli/monkey-interpreter /object"
8
- "github.com/SVendittelli/monkey-interpreter /parser"
6
+ "github.com/SVendittelli/monkey/lexer"
7
+ "github.com/SVendittelli/monkey/object"
8
+ "github.com/SVendittelli/monkey/parser"
9
9
)
10
10
11
11
func TestErrorHandling (t * testing.T ) {
Original file line number Diff line number Diff line change 1
1
package evaluator
2
2
3
3
import (
4
- "github.com/SVendittelli/monkey-interpreter /ast"
5
- "github.com/SVendittelli/monkey-interpreter /object"
4
+ "github.com/SVendittelli/monkey/ast"
5
+ "github.com/SVendittelli/monkey/object"
6
6
)
7
7
8
8
// DefineMacros does two thinds: finding macro definitions in and removing them
Original file line number Diff line number Diff line change @@ -3,10 +3,10 @@ package evaluator
3
3
import (
4
4
"testing"
5
5
6
- "github.com/SVendittelli/monkey-interpreter /ast"
7
- "github.com/SVendittelli/monkey-interpreter /lexer"
8
- "github.com/SVendittelli/monkey-interpreter /object"
9
- "github.com/SVendittelli/monkey-interpreter /parser"
6
+ "github.com/SVendittelli/monkey/ast"
7
+ "github.com/SVendittelli/monkey/lexer"
8
+ "github.com/SVendittelli/monkey/object"
9
+ "github.com/SVendittelli/monkey/parser"
10
10
)
11
11
12
12
func TestDefineMacros (t * testing.T ) {
Original file line number Diff line number Diff line change @@ -3,9 +3,9 @@ package evaluator
3
3
import (
4
4
"fmt"
5
5
6
- "github.com/SVendittelli/monkey-interpreter /ast"
7
- "github.com/SVendittelli/monkey-interpreter /object"
8
- "github.com/SVendittelli/monkey-interpreter /token"
6
+ "github.com/SVendittelli/monkey/ast"
7
+ "github.com/SVendittelli/monkey/object"
8
+ "github.com/SVendittelli/monkey/token"
9
9
)
10
10
11
11
func quote (node ast.Node , env * object.Environment ) object.Object {
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ package evaluator
3
3
import (
4
4
"testing"
5
5
6
- "github.com/SVendittelli/monkey-interpreter /object"
6
+ "github.com/SVendittelli/monkey/object"
7
7
)
8
8
9
9
func TestQuote (t * testing.T ) {
Original file line number Diff line number Diff line change 1
- module github.com/SVendittelli/monkey-interpreter
1
+ module github.com/SVendittelli/monkey
2
2
3
3
go 1.21.6
Original file line number Diff line number Diff line change 1
1
package lexer
2
2
3
- import "github.com/SVendittelli/monkey-interpreter /token"
3
+ import "github.com/SVendittelli/monkey/token"
4
4
5
5
type Lexer struct {
6
6
input string
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ package lexer
3
3
import (
4
4
"testing"
5
5
6
- "github.com/SVendittelli/monkey-interpreter /token"
6
+ "github.com/SVendittelli/monkey/token"
7
7
)
8
8
9
9
func TestNextToken (t * testing.T ) {
Original file line number Diff line number Diff line change 5
5
"os"
6
6
"os/user"
7
7
8
- "github.com/SVendittelli/monkey-interpreter /repl"
8
+ "github.com/SVendittelli/monkey/repl"
9
9
)
10
10
11
11
func main () {
Original file line number Diff line number Diff line change 6
6
"hash/fnv"
7
7
"strings"
8
8
9
- "github.com/SVendittelli/monkey-interpreter /ast"
9
+ "github.com/SVendittelli/monkey/ast"
10
10
)
11
11
12
12
type ObjectType string
Original file line number Diff line number Diff line change 4
4
"fmt"
5
5
"strconv"
6
6
7
- "github.com/SVendittelli/monkey-interpreter /ast"
8
- "github.com/SVendittelli/monkey-interpreter /lexer"
9
- "github.com/SVendittelli/monkey-interpreter /token"
7
+ "github.com/SVendittelli/monkey/ast"
8
+ "github.com/SVendittelli/monkey/lexer"
9
+ "github.com/SVendittelli/monkey/token"
10
10
)
11
11
12
12
const (
Original file line number Diff line number Diff line change 4
4
"fmt"
5
5
"testing"
6
6
7
- "github.com/SVendittelli/monkey-interpreter /ast"
8
- "github.com/SVendittelli/monkey-interpreter /lexer"
7
+ "github.com/SVendittelli/monkey/ast"
8
+ "github.com/SVendittelli/monkey/lexer"
9
9
)
10
10
11
11
func TestLetStatements (t * testing.T ) {
Original file line number Diff line number Diff line change @@ -5,10 +5,10 @@ import (
5
5
"fmt"
6
6
"io"
7
7
8
- "github.com/SVendittelli/monkey-interpreter /evaluator"
9
- "github.com/SVendittelli/monkey-interpreter /lexer"
10
- "github.com/SVendittelli/monkey-interpreter /object"
11
- "github.com/SVendittelli/monkey-interpreter /parser"
8
+ "github.com/SVendittelli/monkey/evaluator"
9
+ "github.com/SVendittelli/monkey/lexer"
10
+ "github.com/SVendittelli/monkey/object"
11
+ "github.com/SVendittelli/monkey/parser"
12
12
)
13
13
14
14
const PROMPT = ">> "
You can’t perform that action at this time.
0 commit comments