Skip to content

Commit 16936f8

Browse files
committed
move module from personal to grol.io/grol
1 parent c465ef7 commit 16936f8

21 files changed

+73
-56
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ go.work.sum
2525
.golangci.yml
2626
.goreleaser.yaml
2727
gorepl
28+
grol
2829

2930
.DS_Store
3031
__*

Makefile

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ all: generate lint tests run
22

33
GO_BUILD_TAGS:=no_net,no_json
44

5-
run: gorepl
6-
./gorepl -parse
5+
run: grol
6+
./grol -parse
77

88
GEN:=object/type_string.go parser/priority_string.go token/type_string.go
99

10-
gorepl: Makefile *.go */*.go $(GEN)
10+
grol: Makefile *.go */*.go $(GEN)
1111
CGO_ENABLED=0 go build -trimpath -ldflags="-w -s" -tags "$(GO_BUILD_TAGS)" .
12-
ls -l gorepl
12+
ls -l grol
1313

14-
tests: gorepl
14+
tests: grol
1515
CGO_ENABLED=0 go test -race -tags $(GO_BUILD_TAGS) ./...
16-
./gorepl *.gr
16+
./grol *.gr
1717

1818
failing-tests:
1919
-go test -v ./... -tags=runfailingtests -run TestLetStatementsFormerlyCrashingNowFailingOnPurpose
@@ -36,9 +36,9 @@ token/type_string.go: token/token.go
3636

3737

3838
clean:
39-
rm -f gorepl */*_string.go
39+
rm -f grol */*_string.go
4040

41-
build: gorepl
41+
build: grol
4242

4343
lint: .golangci.yml
4444
CGO_ENABLED=0 golangci-lint run --build-tags $(GO_BUILD_TAGS)

README.md

+26-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
1-
Following along https://interpreterbook.com and making changes/simplification/cleanups
1+
# GROL
2+
<img src="http://grol.io/grol_logo.png" height=100 width=100 align=right />
3+
4+
## History
5+
6+
Initially created by following along https://interpreterbook.com and making changes/simplification/cleanups
7+
8+
## Install
29

310
Install/run it:
411
```shell
5-
CGO_ENABLED=0 go install -trimpath -ldflags="-w -s" -tags no_net,no_json github.com/ldemailly/gorepl@latest
12+
CGO_ENABLED=0 go install -trimpath -ldflags="-w -s" -tags no_net,no_json grol.io/grol@latest
613
```
714

15+
## What it does
816
Sample:
9-
```shell
17+
```go
1018
gorepl -parse
1119
$ fact = func(n) {if (n<=1) {return 1} n*fact(n-1)}
1220
$ n=fact(6)
@@ -20,24 +28,32 @@ $ m/n
2028
== Eval ==> 7
2129
```
2230

31+
## Language features
32+
33+
Functional int, float, string and boolean expressions
34+
35+
Functions, lambdas, closures
36+
37+
Arrays, maps,
38+
39+
print, log
40+
41+
macros and more all the time
42+
2343
See also [sample.gr](sample.gr) that you can run with
2444
```
2545
gorepl *.gr
2646
```
2747

28-
Dev mode:
48+
## Dev mode:
2949
```shell
3050
go install golang.org/x/tools/cmd/stringer@latest
3151
make # for stripped down executable including build tags etc to make it minimal
3252
```
3353

34-
Status: All done: ie functional int, string and boolean expressions, functions, lambdas, arrays, maps,
35-
print, log, macros and more
36-
37-
3854
### Reading notes
3955

40-
See [Open Issues](https://github.com/ldemailly/gorepl/issues) for what's left to do
56+
See [Open Issues](https://grol.io/grol/issues) for what's left to do
4157

4258
- See the commit history for improvements/changes (e.g redundant state in lexer etc)
4359

@@ -101,7 +117,7 @@ See [Open Issues](https://github.com/ldemailly/gorepl/issues) for what's left to
101117

102118
- [x] switched to non pointer receivers in Object and (base/integer) Ast so equality checks in maps work without special hashing (big win)
103119

104-
### Usage
120+
### CLI Usage
105121

106122
```
107123
gorepl 0.15.0 usage:

ast/ast.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"strconv"
66
"strings"
77

8-
"github.com/ldemailly/gorepl/token"
8+
"grol.io/grol/token"
99
)
1010

1111
type Node interface {

eval/eval.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"strings"
88

99
"fortio.org/log"
10-
"github.com/ldemailly/gorepl/ast"
11-
"github.com/ldemailly/gorepl/object"
12-
"github.com/ldemailly/gorepl/token"
10+
"grol.io/grol/ast"
11+
"grol.io/grol/object"
12+
"grol.io/grol/token"
1313
)
1414

1515
type State struct {

eval/eval_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ package eval_test
33
import (
44
"testing"
55

6-
"github.com/ldemailly/gorepl/eval"
7-
"github.com/ldemailly/gorepl/lexer"
8-
"github.com/ldemailly/gorepl/object"
9-
"github.com/ldemailly/gorepl/parser"
6+
"grol.io/grol/eval"
7+
"grol.io/grol/lexer"
8+
"grol.io/grol/object"
9+
"grol.io/grol/parser"
1010
)
1111

1212
func TestEvalIntegerExpression(t *testing.T) {

eval/macro_expension.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package eval
22

33
import (
44
"fortio.org/log"
5-
"github.com/ldemailly/gorepl/ast"
6-
"github.com/ldemailly/gorepl/object"
5+
"grol.io/grol/ast"
6+
"grol.io/grol/object"
77
)
88

99
func (s *State) DefineMacros(program *ast.Program) {

eval/macro_expension_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ package eval
33
import (
44
"testing"
55

6-
"github.com/ldemailly/gorepl/ast"
7-
"github.com/ldemailly/gorepl/lexer"
8-
"github.com/ldemailly/gorepl/object"
9-
"github.com/ldemailly/gorepl/parser"
6+
"grol.io/grol/ast"
7+
"grol.io/grol/lexer"
8+
"grol.io/grol/object"
9+
"grol.io/grol/parser"
1010
)
1111

1212
func TestDefineMacros(t *testing.T) {

eval/quote_unquote.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"strconv"
55

66
"fortio.org/log"
7-
"github.com/ldemailly/gorepl/ast"
8-
"github.com/ldemailly/gorepl/object"
9-
"github.com/ldemailly/gorepl/token"
7+
"grol.io/grol/ast"
8+
"grol.io/grol/object"
9+
"grol.io/grol/token"
1010
)
1111

1212
func (s *State) quote(node ast.Node) object.Quote {

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/ldemailly/gorepl
1+
module grol.io/grol
22

33
go 1.22.5
44

lexer/lexer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package lexer
33
import (
44
"strings"
55

6-
"github.com/ldemailly/gorepl/token"
6+
"grol.io/grol/token"
77
)
88

99
type Lexer struct {

lexer/lexer_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package lexer
33
import (
44
"testing"
55

6-
"github.com/ldemailly/gorepl/token"
6+
"grol.io/grol/token"
77
)
88

99
func TestNextToken(t *testing.T) { //nolint:funlen // this is a test function with many cases back to back.

main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77

88
"fortio.org/cli"
99
"fortio.org/log"
10-
"github.com/ldemailly/gorepl/eval"
11-
"github.com/ldemailly/gorepl/repl"
10+
"grol.io/grol/eval"
11+
"grol.io/grol/repl"
1212
)
1313

1414
func main() {

object/object.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"strconv"
55
"strings"
66

7-
"github.com/ldemailly/gorepl/ast"
7+
"grol.io/grol/ast"
88
)
99

1010
type Type uint8

object/object_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package object_test
33
import (
44
"testing"
55

6-
"github.com/ldemailly/gorepl/object"
6+
"grol.io/grol/object"
77
)
88

99
func TestStringMapKey(t *testing.T) {

parser/parser.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55
"strconv"
66

77
"fortio.org/log"
8-
"github.com/ldemailly/gorepl/ast"
9-
"github.com/ldemailly/gorepl/lexer"
10-
"github.com/ldemailly/gorepl/token"
8+
"grol.io/grol/ast"
9+
"grol.io/grol/lexer"
10+
"grol.io/grol/token"
1111
)
1212

1313
type Priority int8

parser/parser_book_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"testing"
66

77
"fortio.org/log"
8-
"github.com/ldemailly/gorepl/ast"
9-
"github.com/ldemailly/gorepl/lexer"
8+
"grol.io/grol/ast"
9+
"grol.io/grol/lexer"
1010
)
1111

1212
func TestLetStatements(t *testing.T) {

parser/parser_failing_on_purpose_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"testing"
88

99
"fortio.org/log"
10-
"github.com/ldemailly/gorepl/lexer"
10+
"grol.io/grol/lexer"
1111
)
1212

1313
// show the interface nil check bug (fixed now) - test for error.

parser/parser_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"strconv"
55
"testing"
66

7-
"github.com/ldemailly/gorepl/ast"
8-
"github.com/ldemailly/gorepl/lexer"
9-
"github.com/ldemailly/gorepl/parser"
7+
"grol.io/grol/ast"
8+
"grol.io/grol/lexer"
9+
"grol.io/grol/parser"
1010
)
1111

1212
func Test_LetStatements(t *testing.T) {

repl/repl.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import (
66
"io"
77

88
"fortio.org/log"
9-
"github.com/ldemailly/gorepl/eval"
10-
"github.com/ldemailly/gorepl/lexer"
11-
"github.com/ldemailly/gorepl/object"
12-
"github.com/ldemailly/gorepl/parser"
9+
"grol.io/grol/eval"
10+
"grol.io/grol/lexer"
11+
"grol.io/grol/object"
12+
"grol.io/grol/parser"
1313
)
1414

1515
const (

tags.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var _ = `
1212
INSTALL/BUILD ERROR: this file should not be built with cgo or without no_net or no_json tags, please re
1313
install using
1414
15-
CGO_ENABLED=0 go install -trimpath -ldflags="-w -s" -tags no_net,no_json github.com/ldemailly/gorepl@latest
15+
CGO_ENABLED=0 go install -trimpath -ldflags="-w -s" -tags no_net,no_json grol.io/grol@latest
1616
1717
##############
1818
`.(int)

0 commit comments

Comments
 (0)