Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upDecoupled stdlib from vm, script and compiler #126
Conversation
| runVMError(t, input, nil, userModules, nil, expected) | ||
| } | ||
|
|
||
| func expectErrorWithBuiltinModules(t *testing.T, input string, builtinModules map[string]*objects.Object, expected string) { |
golangcibot
Mar 2, 2019
expectErrorWithBuiltinModules is unused (from deadcode)
expectErrorWithBuiltinModules is unused (from deadcode)
| runVMError(t, input, nil, nil, builtinModules, expected) | ||
| } | ||
|
|
||
| func expectErrorWithUserAndBuiltinModules(t *testing.T, input string, userModules map[string]string, builtinModules map[string]*objects.Object, expected string) { |
golangcibot
Mar 2, 2019
expectErrorWithUserAndBuiltinModules is unused (from deadcode)
expectErrorWithUserAndBuiltinModules is unused (from deadcode)
| @@ -171,8 +187,15 @@ func traceCompileRun(file *ast.File, symbols map[string]objects.Object, userModu | |||
| symTable.DefineBuiltin(idx, fn.Name) | |||
| } | |||
|
|
|||
| bm := make(map[string]bool) | |||
| if builtinModules != nil { | |||
golangcibot
Mar 2, 2019
S1031: unnecessary nil check around range (from gosimple)
S1031: unnecessary nil check around range (from gosimple)
| @@ -171,8 +187,15 @@ func traceCompileRun(file *ast.File, symbols map[string]objects.Object, userModu | |||
| symTable.DefineBuiltin(idx, fn.Name) | |||
| } | |||
|
|
|||
| bm := make(map[string]bool) | |||
| if builtinModules != nil { | |||
| for k, _ := range builtinModules { | |||
golangcibot
Mar 2, 2019
S1005: should omit value from range; this loop is equivalent to for k := range ... (from gosimple)
S1005: should omit value from range; this loop is equivalent to for k := range ... (from gosimple)
|
Hey, nice work as always. I have 2 comments:
|
|
|
Also, I’ll try to work on improving the tests in the packages at some point. There’s some redundant tests that I think can be cleaned up and the focus narrowed a bit more tightly. |
|
Ok. Makes sense. We will have to update documentations, |
| var constants []objects.Object | ||
|
|
||
| for { | ||
| _, _ = fmt.Fprintf(out, replPrompt) |
golangcibot
Mar 4, 2019
SA1006: printf-style function with dynamic format string and no further arguments should use print-style function instead (from staticcheck)
SA1006: printf-style function with dynamic format string and no further arguments should use print-style function instead (from staticcheck)
|
Tengo binary is quite small. I'm not entirely sure the second binary without stdlib bundled is worth it. A flag in the main binary to disable stdlib might be enough. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

stdlib is fully optional. this is in prep for #68