diff --git a/README.md b/README.md index c70c2c7..92277cf 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ import ( "context" "fmt" - "github.com/d5/tengo" + "github.com/d5/tengo/v2" ) func main() { diff --git a/bytecode.go b/bytecode.go index 460d339..cfd0d0b 100644 --- a/bytecode.go +++ b/bytecode.go @@ -6,7 +6,7 @@ import ( "io" "reflect" - "github.com/d5/tengo/parser" + "github.com/d5/tengo/v2/parser" ) // Bytecode is a compiled instructions and constants. diff --git a/bytecode_test.go b/bytecode_test.go index 1aaf35c..7d1a500 100644 --- a/bytecode_test.go +++ b/bytecode_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" - "github.com/d5/tengo" - "github.com/d5/tengo/parser" - "github.com/d5/tengo/require" + "github.com/d5/tengo/v2" + "github.com/d5/tengo/v2/parser" + "github.com/d5/tengo/v2/require" ) type srcfile struct { diff --git a/cmd/bench/main.go b/cmd/bench/main.go index 1e7ddd7..0371d87 100644 --- a/cmd/bench/main.go +++ b/cmd/bench/main.go @@ -4,8 +4,8 @@ import ( "fmt" "time" - "github.com/d5/tengo" - "github.com/d5/tengo/parser" + "github.com/d5/tengo/v2" + "github.com/d5/tengo/v2/parser" ) func main() { diff --git a/cmd/tengo/main.go b/cmd/tengo/main.go index 3eb97be..c73973b 100644 --- a/cmd/tengo/main.go +++ b/cmd/tengo/main.go @@ -11,9 +11,9 @@ import ( "path/filepath" "strings" - "github.com/d5/tengo" - "github.com/d5/tengo/parser" - "github.com/d5/tengo/stdlib" + "github.com/d5/tengo/v2" + "github.com/d5/tengo/v2/parser" + "github.com/d5/tengo/v2/stdlib" ) const ( diff --git a/compiler.go b/compiler.go index 3f8373d..eb686ed 100644 --- a/compiler.go +++ b/compiler.go @@ -8,8 +8,8 @@ import ( "reflect" "strings" - "github.com/d5/tengo/parser" - "github.com/d5/tengo/token" + "github.com/d5/tengo/v2/parser" + "github.com/d5/tengo/v2/token" ) // compilationScope represents a compiled instructions and the last two diff --git a/compiler_test.go b/compiler_test.go index 6f8619d..09f609f 100644 --- a/compiler_test.go +++ b/compiler_test.go @@ -5,9 +5,9 @@ import ( "strings" "testing" - "github.com/d5/tengo" - "github.com/d5/tengo/parser" - "github.com/d5/tengo/require" + "github.com/d5/tengo/v2" + "github.com/d5/tengo/v2/parser" + "github.com/d5/tengo/v2/require" ) func TestCompiler_Compile(t *testing.T) { diff --git a/docs/interoperability.md b/docs/interoperability.md index 6c01be3..e0f7759 100644 --- a/docs/interoperability.md +++ b/docs/interoperability.md @@ -26,7 +26,7 @@ The following is an example where a Tengo script is compiled and run with no input/output variables. ```golang -import "github.com/d5/tengo" +import "github.com/d5/tengo/v2" var code = ` reduce := func(seq, fn) { @@ -54,7 +54,7 @@ output variable is accessed through import ( "fmt" - "github.com/d5/tengo" + "github.com/d5/tengo/v2" ) func main() { diff --git a/example_test.go b/example_test.go index 2ff3078..5f074d8 100644 --- a/example_test.go +++ b/example_test.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/d5/tengo" + "github.com/d5/tengo/v2" ) func Example() { diff --git a/go.mod b/go.mod index a8c5c11..732ff14 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module github.com/d5/tengo +module github.com/d5/tengo/v2 go 1.13 diff --git a/instructions.go b/instructions.go index 9888e4b..eb1fbf2 100644 --- a/instructions.go +++ b/instructions.go @@ -3,7 +3,7 @@ package tengo import ( "fmt" - "github.com/d5/tengo/parser" + "github.com/d5/tengo/v2/parser" ) // MakeInstruction returns a bytecode for an opcode and the operands. diff --git a/objects.go b/objects.go index dc346a3..27c1d49 100644 --- a/objects.go +++ b/objects.go @@ -8,8 +8,8 @@ import ( "strings" "time" - "github.com/d5/tengo/parser" - "github.com/d5/tengo/token" + "github.com/d5/tengo/v2/parser" + "github.com/d5/tengo/v2/token" ) var ( diff --git a/objects_test.go b/objects_test.go index 807a509..29a0b7d 100644 --- a/objects_test.go +++ b/objects_test.go @@ -3,9 +3,9 @@ package tengo_test import ( "testing" - "github.com/d5/tengo" - "github.com/d5/tengo/require" - "github.com/d5/tengo/token" + "github.com/d5/tengo/v2" + "github.com/d5/tengo/v2/require" + "github.com/d5/tengo/v2/token" ) func TestObject_TypeName(t *testing.T) { diff --git a/parser/ast_test.go b/parser/ast_test.go index 9b67138..eb0eb93 100644 --- a/parser/ast_test.go +++ b/parser/ast_test.go @@ -3,7 +3,7 @@ package parser_test import ( "testing" - "github.com/d5/tengo/parser" + "github.com/d5/tengo/v2/parser" ) func TestIdentListString(t *testing.T) { diff --git a/parser/expr.go b/parser/expr.go index 3ea9b57..71e5155 100644 --- a/parser/expr.go +++ b/parser/expr.go @@ -3,7 +3,7 @@ package parser import ( "strings" - "github.com/d5/tengo/token" + "github.com/d5/tengo/v2/token" ) // Expr represents an expression node in the AST. diff --git a/parser/parser.go b/parser/parser.go index 051ca0b..501a910 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -6,7 +6,7 @@ import ( "sort" "strconv" - "github.com/d5/tengo/token" + "github.com/d5/tengo/v2/token" ) type bailout struct{} diff --git a/parser/parser_test.go b/parser/parser_test.go index 1ec5ec9..476d4e3 100644 --- a/parser/parser_test.go +++ b/parser/parser_test.go @@ -7,9 +7,9 @@ import ( "strings" "testing" - . "github.com/d5/tengo/parser" - "github.com/d5/tengo/require" - "github.com/d5/tengo/token" + . "github.com/d5/tengo/v2/parser" + "github.com/d5/tengo/v2/require" + "github.com/d5/tengo/v2/token" ) func TestParserError(t *testing.T) { diff --git a/parser/scanner.go b/parser/scanner.go index a168cfb..f1d820a 100644 --- a/parser/scanner.go +++ b/parser/scanner.go @@ -5,7 +5,7 @@ import ( "unicode" "unicode/utf8" - "github.com/d5/tengo/token" + "github.com/d5/tengo/v2/token" ) // byte order mark diff --git a/parser/scanner_test.go b/parser/scanner_test.go index 390851d..1f6ca56 100644 --- a/parser/scanner_test.go +++ b/parser/scanner_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" - "github.com/d5/tengo/parser" - "github.com/d5/tengo/require" - "github.com/d5/tengo/token" + "github.com/d5/tengo/v2/parser" + "github.com/d5/tengo/v2/require" + "github.com/d5/tengo/v2/token" ) var testFileSet = parser.NewFileSet() diff --git a/parser/stmt.go b/parser/stmt.go index 1b4de48..c0848c4 100644 --- a/parser/stmt.go +++ b/parser/stmt.go @@ -3,7 +3,7 @@ package parser import ( "strings" - "github.com/d5/tengo/token" + "github.com/d5/tengo/v2/token" ) // Stmt represents a statement in the AST. diff --git a/require/require.go b/require/require.go index 918a268..99c1a7c 100644 --- a/require/require.go +++ b/require/require.go @@ -10,9 +10,9 @@ import ( "unicode" "unicode/utf8" - "github.com/d5/tengo" - "github.com/d5/tengo/parser" - "github.com/d5/tengo/token" + "github.com/d5/tengo/v2" + "github.com/d5/tengo/v2/parser" + "github.com/d5/tengo/v2/token" ) // NoError asserts err is not an error. diff --git a/script.go b/script.go index adee2ae..906771d 100644 --- a/script.go +++ b/script.go @@ -5,7 +5,7 @@ import ( "fmt" "sync" - "github.com/d5/tengo/parser" + "github.com/d5/tengo/v2/parser" ) // Script can simplify compilation and execution of embedded scripts. diff --git a/script_test.go b/script_test.go index 622cab7..5e8f363 100644 --- a/script_test.go +++ b/script_test.go @@ -10,10 +10,10 @@ import ( "testing" "time" - "github.com/d5/tengo" - "github.com/d5/tengo/require" - "github.com/d5/tengo/stdlib" - "github.com/d5/tengo/token" + "github.com/d5/tengo/v2" + "github.com/d5/tengo/v2/require" + "github.com/d5/tengo/v2/stdlib" + "github.com/d5/tengo/v2/token" ) func TestScript_Add(t *testing.T) { diff --git a/stdlib/base64.go b/stdlib/base64.go index 6a34066..b4c5b56 100644 --- a/stdlib/base64.go +++ b/stdlib/base64.go @@ -3,7 +3,7 @@ package stdlib import ( "encoding/base64" - "github.com/d5/tengo" + "github.com/d5/tengo/v2" ) var base64Module = map[string]tengo.Object{ diff --git a/stdlib/builtin_modules.go b/stdlib/builtin_modules.go index b8ddaca..cf0e962 100644 --- a/stdlib/builtin_modules.go +++ b/stdlib/builtin_modules.go @@ -1,7 +1,7 @@ package stdlib import ( - "github.com/d5/tengo" + "github.com/d5/tengo/v2" ) // BuiltinModules are builtin type standard library modules. diff --git a/stdlib/errors.go b/stdlib/errors.go index eeefce5..ad83c6f 100644 --- a/stdlib/errors.go +++ b/stdlib/errors.go @@ -1,7 +1,7 @@ package stdlib import ( - "github.com/d5/tengo" + "github.com/d5/tengo/v2" ) func wrapError(err error) tengo.Object { diff --git a/stdlib/fmt.go b/stdlib/fmt.go index e8eeb95..9945277 100644 --- a/stdlib/fmt.go +++ b/stdlib/fmt.go @@ -3,7 +3,7 @@ package stdlib import ( "fmt" - "github.com/d5/tengo" + "github.com/d5/tengo/v2" ) var fmtModule = map[string]tengo.Object{ diff --git a/stdlib/func_typedefs.go b/stdlib/func_typedefs.go index 5661545..fdac933 100644 --- a/stdlib/func_typedefs.go +++ b/stdlib/func_typedefs.go @@ -3,7 +3,7 @@ package stdlib import ( "fmt" - "github.com/d5/tengo" + "github.com/d5/tengo/v2" ) // FuncAR transform a function of 'func()' signature into CallableFunc type. diff --git a/stdlib/func_typedefs_test.go b/stdlib/func_typedefs_test.go index 8368fca..091c5c4 100644 --- a/stdlib/func_typedefs_test.go +++ b/stdlib/func_typedefs_test.go @@ -6,9 +6,9 @@ import ( "strings" "testing" - "github.com/d5/tengo" - "github.com/d5/tengo/require" - "github.com/d5/tengo/stdlib" + "github.com/d5/tengo/v2" + "github.com/d5/tengo/v2/require" + "github.com/d5/tengo/v2/stdlib" ) func TestFuncAIR(t *testing.T) { diff --git a/stdlib/hex.go b/stdlib/hex.go index 035456e..981da69 100644 --- a/stdlib/hex.go +++ b/stdlib/hex.go @@ -3,7 +3,7 @@ package stdlib import ( "encoding/hex" - "github.com/d5/tengo" + "github.com/d5/tengo/v2" ) var hexModule = map[string]tengo.Object{ diff --git a/stdlib/json.go b/stdlib/json.go index 342c9c0..be2185d 100644 --- a/stdlib/json.go +++ b/stdlib/json.go @@ -4,8 +4,8 @@ import ( "bytes" gojson "encoding/json" - "github.com/d5/tengo" - "github.com/d5/tengo/stdlib/json" + "github.com/d5/tengo/v2" + "github.com/d5/tengo/v2/stdlib/json" ) var jsonModule = map[string]tengo.Object{ diff --git a/stdlib/json/decode.go b/stdlib/json/decode.go index 98dad0e..6d468ef 100644 --- a/stdlib/json/decode.go +++ b/stdlib/json/decode.go @@ -12,7 +12,7 @@ import ( "unicode/utf16" "unicode/utf8" - "github.com/d5/tengo" + "github.com/d5/tengo/v2" ) // Decode parses the JSON-encoded data and returns the result object. diff --git a/stdlib/json/encode.go b/stdlib/json/encode.go index 25d3b28..ab7ca6f 100644 --- a/stdlib/json/encode.go +++ b/stdlib/json/encode.go @@ -12,7 +12,7 @@ import ( "math" "strconv" - "github.com/d5/tengo" + "github.com/d5/tengo/v2" ) // Encode returns the JSON encoding of the object. diff --git a/stdlib/json/json_test.go b/stdlib/json/json_test.go index e8e8fde..7fc6a04 100644 --- a/stdlib/json/json_test.go +++ b/stdlib/json/json_test.go @@ -4,9 +4,9 @@ import ( gojson "encoding/json" "testing" - "github.com/d5/tengo" - "github.com/d5/tengo/require" - "github.com/d5/tengo/stdlib/json" + "github.com/d5/tengo/v2" + "github.com/d5/tengo/v2/require" + "github.com/d5/tengo/v2/stdlib/json" ) type ARR = []interface{} diff --git a/stdlib/math.go b/stdlib/math.go index 156b203..633ea09 100644 --- a/stdlib/math.go +++ b/stdlib/math.go @@ -3,7 +3,7 @@ package stdlib import ( "math" - "github.com/d5/tengo" + "github.com/d5/tengo/v2" ) var mathModule = map[string]tengo.Object{ diff --git a/stdlib/os.go b/stdlib/os.go index 88bd041..576bc94 100644 --- a/stdlib/os.go +++ b/stdlib/os.go @@ -7,7 +7,7 @@ import ( "os" "os/exec" - "github.com/d5/tengo" + "github.com/d5/tengo/v2" ) var osModule = map[string]tengo.Object{ diff --git a/stdlib/os_exec.go b/stdlib/os_exec.go index eca4181..7ee5c1c 100644 --- a/stdlib/os_exec.go +++ b/stdlib/os_exec.go @@ -3,7 +3,7 @@ package stdlib import ( "os/exec" - "github.com/d5/tengo" + "github.com/d5/tengo/v2" ) func makeOSExecCommand(cmd *exec.Cmd) *tengo.ImmutableMap { diff --git a/stdlib/os_file.go b/stdlib/os_file.go index 43293f2..4f59b4c 100644 --- a/stdlib/os_file.go +++ b/stdlib/os_file.go @@ -3,7 +3,7 @@ package stdlib import ( "os" - "github.com/d5/tengo" + "github.com/d5/tengo/v2" ) func makeOSFile(file *os.File) *tengo.ImmutableMap { diff --git a/stdlib/os_process.go b/stdlib/os_process.go index 621e569..7fcf27a 100644 --- a/stdlib/os_process.go +++ b/stdlib/os_process.go @@ -4,7 +4,7 @@ import ( "os" "syscall" - "github.com/d5/tengo" + "github.com/d5/tengo/v2" ) func makeOSProcessState(state *os.ProcessState) *tengo.ImmutableMap { diff --git a/stdlib/os_test.go b/stdlib/os_test.go index d2cd804..46c7f60 100644 --- a/stdlib/os_test.go +++ b/stdlib/os_test.go @@ -5,8 +5,8 @@ import ( "os" "testing" - "github.com/d5/tengo" - "github.com/d5/tengo/require" + "github.com/d5/tengo/v2" + "github.com/d5/tengo/v2/require" ) func TestReadFile(t *testing.T) { diff --git a/stdlib/rand.go b/stdlib/rand.go index 311b5d9..5d21e1d 100644 --- a/stdlib/rand.go +++ b/stdlib/rand.go @@ -3,7 +3,7 @@ package stdlib import ( "math/rand" - "github.com/d5/tengo" + "github.com/d5/tengo/v2" ) var randModule = map[string]tengo.Object{ diff --git a/stdlib/rand_test.go b/stdlib/rand_test.go index 5428f54..eed3e8c 100644 --- a/stdlib/rand_test.go +++ b/stdlib/rand_test.go @@ -4,8 +4,8 @@ import ( "math/rand" "testing" - "github.com/d5/tengo" - "github.com/d5/tengo/require" + "github.com/d5/tengo/v2" + "github.com/d5/tengo/v2/require" ) func TestRand(t *testing.T) { diff --git a/stdlib/stdlib.go b/stdlib/stdlib.go index 5cafcd0..16c369a 100644 --- a/stdlib/stdlib.go +++ b/stdlib/stdlib.go @@ -3,7 +3,7 @@ package stdlib //go:generate go run gensrcmods.go import ( - "github.com/d5/tengo" + "github.com/d5/tengo/v2" ) // AllModuleNames returns a list of all default module names. diff --git a/stdlib/stdlib_test.go b/stdlib/stdlib_test.go index ec8756a..ecd5978 100644 --- a/stdlib/stdlib_test.go +++ b/stdlib/stdlib_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" - "github.com/d5/tengo" - "github.com/d5/tengo/require" - "github.com/d5/tengo/stdlib" + "github.com/d5/tengo/v2" + "github.com/d5/tengo/v2/require" + "github.com/d5/tengo/v2/stdlib" ) type ARR = []interface{} diff --git a/stdlib/text.go b/stdlib/text.go index 99edf37..d7d5d1d 100644 --- a/stdlib/text.go +++ b/stdlib/text.go @@ -7,7 +7,7 @@ import ( "strings" "unicode/utf8" - "github.com/d5/tengo" + "github.com/d5/tengo/v2" ) var textModule = map[string]tengo.Object{ diff --git a/stdlib/text_regexp.go b/stdlib/text_regexp.go index f2efe37..1a7ecf0 100644 --- a/stdlib/text_regexp.go +++ b/stdlib/text_regexp.go @@ -3,7 +3,7 @@ package stdlib import ( "regexp" - "github.com/d5/tengo" + "github.com/d5/tengo/v2" ) func makeTextRegexp(re *regexp.Regexp) *tengo.ImmutableMap { diff --git a/stdlib/text_test.go b/stdlib/text_test.go index 5299760..e3674c7 100644 --- a/stdlib/text_test.go +++ b/stdlib/text_test.go @@ -4,7 +4,7 @@ import ( "regexp" "testing" - "github.com/d5/tengo" + "github.com/d5/tengo/v2" ) func TestTextRE(t *testing.T) { diff --git a/stdlib/times.go b/stdlib/times.go index 3440e79..0b6f7bd 100644 --- a/stdlib/times.go +++ b/stdlib/times.go @@ -3,7 +3,7 @@ package stdlib import ( "time" - "github.com/d5/tengo" + "github.com/d5/tengo/v2" ) var timesModule = map[string]tengo.Object{ diff --git a/stdlib/times_test.go b/stdlib/times_test.go index efb85b6..6977ba4 100644 --- a/stdlib/times_test.go +++ b/stdlib/times_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "github.com/d5/tengo" - "github.com/d5/tengo/require" + "github.com/d5/tengo/v2" + "github.com/d5/tengo/v2/require" ) func TestTimes(t *testing.T) { diff --git a/symbol_table_test.go b/symbol_table_test.go index 4376ffb..04833f4 100644 --- a/symbol_table_test.go +++ b/symbol_table_test.go @@ -3,8 +3,8 @@ package tengo_test import ( "testing" - "github.com/d5/tengo" - "github.com/d5/tengo/require" + "github.com/d5/tengo/v2" + "github.com/d5/tengo/v2/require" ) func TestSymbolTable(t *testing.T) { diff --git a/tengo_test.go b/tengo_test.go index cae2237..d1f5e8a 100644 --- a/tengo_test.go +++ b/tengo_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" - "github.com/d5/tengo" - "github.com/d5/tengo/parser" - "github.com/d5/tengo/require" + "github.com/d5/tengo/v2" + "github.com/d5/tengo/v2/parser" + "github.com/d5/tengo/v2/require" ) func TestInstructions_String(t *testing.T) { diff --git a/variable_test.go b/variable_test.go index 0268035..f39c9c9 100644 --- a/variable_test.go +++ b/variable_test.go @@ -3,8 +3,8 @@ package tengo_test import ( "testing" - "github.com/d5/tengo" - "github.com/d5/tengo/require" + "github.com/d5/tengo/v2" + "github.com/d5/tengo/v2/require" ) type VariableTest struct { diff --git a/vm.go b/vm.go index 1f14771..783a54a 100644 --- a/vm.go +++ b/vm.go @@ -4,8 +4,8 @@ import ( "fmt" "sync/atomic" - "github.com/d5/tengo/parser" - "github.com/d5/tengo/token" + "github.com/d5/tengo/v2/parser" + "github.com/d5/tengo/v2/token" ) // frame represents a function call frame. diff --git a/vm_test.go b/vm_test.go index 3dc3dab..60e17b1 100644 --- a/vm_test.go +++ b/vm_test.go @@ -10,11 +10,11 @@ import ( "strings" "testing" - "github.com/d5/tengo" - "github.com/d5/tengo/parser" - "github.com/d5/tengo/require" - "github.com/d5/tengo/stdlib" - "github.com/d5/tengo/token" + "github.com/d5/tengo/v2" + "github.com/d5/tengo/v2/parser" + "github.com/d5/tengo/v2/require" + "github.com/d5/tengo/v2/stdlib" + "github.com/d5/tengo/v2/token" ) const testOut = "out"