Skip to content

Commit

Permalink
add repl
Browse files Browse the repository at this point in the history
  • Loading branch information
urionz committed Mar 18, 2021
1 parent 7ee4e3b commit 56c24e6
Show file tree
Hide file tree
Showing 109 changed files with 4,039 additions and 2 deletions.
3 changes: 3 additions & 0 deletions _examples/.repl/sessions/119373000/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module shell
go 1.13

9 changes: 9 additions & 0 deletions _examples/.repl/sessions/119373000/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package main

import "fmt"

var ()

func main() {
fmt.Printf("<%T> %+v\n", 1, 1)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
2021-03-18 11:36:32 INFO /Users/urionz/WorkSpace/Code/docker/wwwroot/github.urionz/tgoofy/cmds/repl/repl.go:74 :::::: D => 98.188µs

1 change: 1 addition & 0 deletions _examples/.repl/sessions/119373000/storage/info.log
3 changes: 3 additions & 0 deletions _examples/.repl/sessions/182615000/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module shell
go 1.14

12 changes: 12 additions & 0 deletions _examples/.repl/sessions/182615000/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main
imports (

)


var(

)
func main() {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
2021-03-18 11:20:31 PANIC /Users/urionz/WorkSpace/Code/docker/wwwroot/github.urionz/tgoofy/cmds/repl/repl.go:39 2:1: expected declaration, found imports

1 change: 1 addition & 0 deletions _examples/.repl/sessions/182615000/storage/warn.log
3 changes: 3 additions & 0 deletions _examples/.repl/sessions/263707000/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module shell
go 1.13

9 changes: 9 additions & 0 deletions _examples/.repl/sessions/263707000/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package main

import "fmt"

var ()

func main() {
fmt.Printf("<%T> %+v\n", clear, clear)
}
3 changes: 3 additions & 0 deletions _examples/.repl/sessions/304554000/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module shell
go 1.13

9 changes: 9 additions & 0 deletions _examples/.repl/sessions/304554000/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package main

import "fmt"

var ()

func main() {
fmt.Printf("<%T> %+v\n", quit, quit)
}
3 changes: 3 additions & 0 deletions _examples/.repl/sessions/309378000/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module shell
go 1.14

12 changes: 12 additions & 0 deletions _examples/.repl/sessions/309378000/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main
imports (

)


var(

)
func main() {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
2021-03-18 11:23:12 PANIC /Users/urionz/WorkSpace/Code/docker/wwwroot/github.urionz/tgoofy/cmds/repl/repl.go:39 2:1: expected declaration, found imports

1 change: 1 addition & 0 deletions _examples/.repl/sessions/309378000/storage/warn.log
3 changes: 3 additions & 0 deletions _examples/.repl/sessions/423067000/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module shell
go 1.13

12 changes: 12 additions & 0 deletions _examples/.repl/sessions/423067000/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main

import (
"encoding/json"
"fmt"
)

var ()

func main() {
fmt.Printf("<%T> %+v\n", json.Marshal, json.Marshal)
}
3 changes: 3 additions & 0 deletions _examples/.repl/sessions/462322000/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module shell
go 1.14

12 changes: 12 additions & 0 deletions _examples/.repl/sessions/462322000/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main
imports (

)


var(

)
func main() {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
2021-03-18 11:19:58 PANIC /Users/urionz/WorkSpace/Code/docker/wwwroot/github.urionz/tgoofy/cmds/repl/repl.go:39 2:1: expected declaration, found imports

1 change: 1 addition & 0 deletions _examples/.repl/sessions/462322000/storage/warn.log
3 changes: 3 additions & 0 deletions _examples/.repl/sessions/600989000/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module shell
go 1.14

12 changes: 12 additions & 0 deletions _examples/.repl/sessions/600989000/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main
imports (

)


var(

)
func main() {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
2021-03-18 11:18:46 PANIC /Users/urionz/WorkSpace/Code/docker/wwwroot/github.urionz/tgoofy/cmds/repl/repl.go:39 2:1: expected declaration, found imports

1 change: 1 addition & 0 deletions _examples/.repl/sessions/600989000/storage/warn.log
3 changes: 3 additions & 0 deletions _examples/.repl/sessions/603317000/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module shell
go 1.14

12 changes: 12 additions & 0 deletions _examples/.repl/sessions/603317000/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main
imports (

)


var(

)
func main() {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
2021-03-18 11:25:01 PANIC /Users/urionz/WorkSpace/Code/docker/wwwroot/github.urionz/tgoofy/cmds/repl/repl.go:39 2:1: expected declaration, found imports

1 change: 1 addition & 0 deletions _examples/.repl/sessions/603317000/storage/warn.log
3 changes: 3 additions & 0 deletions _examples/.repl/sessions/604444000/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module shell
go 1.13

19 changes: 19 additions & 0 deletions _examples/.repl/sessions/604444000/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package main

import "fmt"

type abc struct {
bbb string
}

func somefun() string {
return "abs"
}

var (
m = &abc{bbb: "asdsdsa"}
)

func main() {
fmt.Printf("<%T> %+v\n", m.bbb, m.bbb)
}
3 changes: 3 additions & 0 deletions _examples/.repl/sessions/608932000/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module shell
go 1.14

12 changes: 12 additions & 0 deletions _examples/.repl/sessions/608932000/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main
imports (

)


var(

)
func main() {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
2021-03-18 11:20:07 PANIC /Users/urionz/WorkSpace/Code/docker/wwwroot/github.urionz/tgoofy/cmds/repl/repl.go:39 2:1: expected declaration, found imports

1 change: 1 addition & 0 deletions _examples/.repl/sessions/608932000/storage/warn.log
3 changes: 3 additions & 0 deletions _examples/.repl/sessions/611769000/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module shell
go 1.14

12 changes: 12 additions & 0 deletions _examples/.repl/sessions/611769000/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main
imports (

)


var(

)
func main() {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
2021-03-18 11:24:34 PANIC /Users/urionz/WorkSpace/Code/docker/wwwroot/github.urionz/tgoofy/cmds/repl/repl.go:39 2:1: expected declaration, found imports

1 change: 1 addition & 0 deletions _examples/.repl/sessions/611769000/storage/warn.log
3 changes: 3 additions & 0 deletions _examples/.repl/sessions/648049000/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module shell
go 1.14

12 changes: 12 additions & 0 deletions _examples/.repl/sessions/648049000/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main
imports (

)


var(

)
func main() {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
2021-03-18 11:22:24 PANIC /Users/urionz/WorkSpace/Code/docker/wwwroot/github.urionz/tgoofy/cmds/repl/repl.go:39 2:1: expected declaration, found imports

1 change: 1 addition & 0 deletions _examples/.repl/sessions/648049000/storage/warn.log
3 changes: 3 additions & 0 deletions _examples/.repl/sessions/699212000/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module shell
go 1.13

9 changes: 9 additions & 0 deletions _examples/.repl/sessions/699212000/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package main

import "fmt"

var ()

func main() {
fmt.Printf("<%T> %+v\n", asdsadsadsad, asdsadsadsad)
}
3 changes: 3 additions & 0 deletions _examples/.repl/sessions/72087000/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module shell
go 1.13

9 changes: 9 additions & 0 deletions _examples/.repl/sessions/72087000/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package main

import "fmt"

var ()

func main() {
fmt.Printf("<%T> %+v\n", 1, 1)
}
3 changes: 3 additions & 0 deletions _examples/.repl/sessions/729906000/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module shell
go 1.13

14 changes: 14 additions & 0 deletions _examples/.repl/sessions/729906000/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package main

import (
"encoding/json"
"fmt"
)

var (
bs, _ = json.Marshal("1")
)

func main() {
fmt.Printf("<%T> %+v\n", echo, echo)
}
33 changes: 33 additions & 0 deletions _examples/.repl/sessions/729906000/storage/warn-2021-03-18.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
2021-03-18 11:29:34 ERROR /Users/urionz/WorkSpace/Code/docker/wwwroot/github.urionz/tgoofy/cmds/repl/repl.go:56 Panic: runtime error: slice bounds out of range [:-1]
goroutine 1 [running]:
runtime/debug.Stack(0xc000997508, 0x1faaf40, 0xc00069ac80)
/Users/urionz/.g/go/src/runtime/debug/stack.go:24 +0x9d
github.com/urionz/goofy/cmds/repl.handler.func1()
/Users/urionz/WorkSpace/Code/docker/wwwroot/github.urionz/tgoofy/cmds/repl/repl.go:56 +0x57
panic(0x1faaf40, 0xc00069ac80)
/Users/urionz/.g/go/src/runtime/panic.go:969 +0x166
github.com/urionz/goofy/cmds/repl/interpreter.(*Interpreter).handleShellCommands(0xc000152630, 0xc0004a67b0, 0x4, 0x1e57000, 0xc000510000, 0x3096e98, 0x0)
/Users/urionz/WorkSpace/Code/docker/wwwroot/github.urionz/tgoofy/cmds/repl/interpreter/cmd.go:48 +0x6ce
github.com/urionz/goofy/cmds/repl/interpreter.(*Interpreter).addCode(0xc000152630, 0x4, 0xc0004a67b0, 0x4, 0x0, 0xc000997920, 0x1440ca8, 0x1441340)
/Users/urionz/WorkSpace/Code/docker/wwwroot/github.urionz/tgoofy/cmds/repl/interpreter/session.go:91 +0x909
github.com/urionz/goofy/cmds/repl/interpreter.(*Interpreter).Eval(0xc000152630, 0xc0004a67b0, 0x4, 0x0, 0xc000997990, 0x1cad467, 0x8)
/Users/urionz/WorkSpace/Code/docker/wwwroot/github.urionz/tgoofy/cmds/repl/interpreter/session.go:129 +0xc1
github.com/urionz/goofy/cmds/repl.handler(0xc0004a67b0, 0x4)
/Users/urionz/WorkSpace/Code/docker/wwwroot/github.urionz/tgoofy/cmds/repl/repl.go:65 +0xa3
github.com/c-bata/go-prompt.(*Prompt).Run(0xc0006c21b0)
/Users/urionz/.g/go_path/pkg/mod/github.com/c-bata/[email protected]/prompt.go:84 +0x845
github.com/urionz/goofy/cmds/repl.Command.func2(0xc00028c780, 0xc000128030, 0x0, 0x0, 0x1, 0x1)
/Users/urionz/WorkSpace/Code/docker/wwwroot/github.urionz/tgoofy/cmds/repl/repl.go:42 +0x1da
github.com/gookit/gcli/v3.(*Command).doExecute(0xc00028c780, 0xc000128030, 0x0, 0x0, 0x2, 0x2)
/Users/urionz/.g/go_path/pkg/mod/github.com/gookit/gcli/[email protected]/cmd.go:538 +0x3ba
github.com/gookit/gcli/v3.(*Command).innerDispatch(0xc00028c780, 0xc000128030, 0x0, 0x0, 0x2, 0x2)
/Users/urionz/.g/go_path/pkg/mod/github.com/gookit/gcli/[email protected]/cmd.go:472 +0x4e0
github.com/gookit/gcli/v3.(*App).doRunCmd(0xc0001d1180, 0x7ffeefbff691, 0x4, 0xc000128030, 0x0, 0x0, 0x10161fa)
/Users/urionz/.g/go_path/pkg/mod/github.com/gookit/gcli/[email protected]/app.go:446 +0x208
github.com/gookit/gcli/v3.(*App).Run(0xc0001d1180, 0x0, 0x1, 0x1, 0x0)
/Users/urionz/.g/go_path/pkg/mod/github.com/gookit/gcli/[email protected]/app.go:429 +0x273
github.com/urionz/goofy.(*Application).Run(0xc0006a6bd0, 0xc00055d5c0, 0x1)
/Users/urionz/WorkSpace/Code/docker/wwwroot/github.urionz/tgoofy/goofy.go:96 +0xb7
main.main()
/Users/urionz/WorkSpace/Code/docker/wwwroot/github.urionz/tgoofy/_examples/main.go:18 +0x91

1 change: 1 addition & 0 deletions _examples/.repl/sessions/729906000/storage/warn.log
3 changes: 3 additions & 0 deletions _examples/.repl/sessions/749620000/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module shell
go 1.14

12 changes: 12 additions & 0 deletions _examples/.repl/sessions/749620000/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main
imports (

)


var(

)
func main() {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
2021-03-18 11:23:21 PANIC /Users/urionz/WorkSpace/Code/docker/wwwroot/github.urionz/tgoofy/cmds/repl/repl.go:39 2:1: expected declaration, found imports

1 change: 1 addition & 0 deletions _examples/.repl/sessions/749620000/storage/warn.log
3 changes: 3 additions & 0 deletions _examples/.repl/sessions/759819000/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module shell
go 1.13

Loading

0 comments on commit 56c24e6

Please sign in to comment.