Update dependencies and build to go1.22 (#2113)
* Update dependencies and build to go1.22 * Fix api changes wrt to dependencies * Update golangci config
This commit is contained in:
4
vendor/github.com/d5/tengo/v2/.gitignore
generated
vendored
4
vendor/github.com/d5/tengo/v2/.gitignore
generated
vendored
@@ -1 +1,3 @@
|
||||
dist/
|
||||
dist/
|
||||
|
||||
.idea
|
||||
6
vendor/github.com/d5/tengo/v2/instructions.go
generated
vendored
6
vendor/github.com/d5/tengo/v2/instructions.go
generated
vendored
@@ -28,6 +28,12 @@ func MakeInstruction(opcode parser.Opcode, operands ...int) []byte {
|
||||
n := uint16(o)
|
||||
instruction[offset] = byte(n >> 8)
|
||||
instruction[offset+1] = byte(n)
|
||||
case 4:
|
||||
n := uint32(o)
|
||||
instruction[offset] = byte(n >> 24)
|
||||
instruction[offset+1] = byte(n >> 16)
|
||||
instruction[offset+2] = byte(n >> 8)
|
||||
instruction[offset+3] = byte(n)
|
||||
}
|
||||
offset += width
|
||||
}
|
||||
|
||||
2
vendor/github.com/d5/tengo/v2/parser/expr.go
generated
vendored
2
vendor/github.com/d5/tengo/v2/parser/expr.go
generated
vendored
@@ -351,7 +351,7 @@ func (e *ImportExpr) End() Pos {
|
||||
}
|
||||
|
||||
func (e *ImportExpr) String() string {
|
||||
return `import("` + e.ModuleName + `")"`
|
||||
return `import("` + e.ModuleName + `")`
|
||||
}
|
||||
|
||||
// IndexExpr represents an index expression.
|
||||
|
||||
10
vendor/github.com/d5/tengo/v2/parser/opcodes.go
generated
vendored
10
vendor/github.com/d5/tengo/v2/parser/opcodes.go
generated
vendored
@@ -106,10 +106,10 @@ var OpcodeOperands = [...][]int{
|
||||
OpNotEqual: {},
|
||||
OpMinus: {},
|
||||
OpLNot: {},
|
||||
OpJumpFalsy: {2},
|
||||
OpAndJump: {2},
|
||||
OpOrJump: {2},
|
||||
OpJump: {2},
|
||||
OpJumpFalsy: {4},
|
||||
OpAndJump: {4},
|
||||
OpOrJump: {4},
|
||||
OpJump: {4},
|
||||
OpNull: {},
|
||||
OpGetGlobal: {2},
|
||||
OpSetGlobal: {2},
|
||||
@@ -149,6 +149,8 @@ func ReadOperands(numOperands []int, ins []byte) (operands []int, offset int) {
|
||||
operands = append(operands, int(ins[offset]))
|
||||
case 2:
|
||||
operands = append(operands, int(ins[offset+1])|int(ins[offset])<<8)
|
||||
case 4:
|
||||
operands = append(operands, int(ins[offset+3])|int(ins[offset+2])<<8|int(ins[offset+1])<<16|int(ins[offset])<<24)
|
||||
}
|
||||
offset += width
|
||||
}
|
||||
|
||||
3
vendor/github.com/d5/tengo/v2/stdlib/os.go
generated
vendored
3
vendor/github.com/d5/tengo/v2/stdlib/os.go
generated
vendored
@@ -6,11 +6,14 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
|
||||
"github.com/d5/tengo/v2"
|
||||
)
|
||||
|
||||
var osModule = map[string]tengo.Object{
|
||||
"platform": &tengo.String{Value: runtime.GOOS},
|
||||
"arch": &tengo.String{Value: runtime.GOARCH},
|
||||
"o_rdonly": &tengo.Int{Value: int64(os.O_RDONLY)},
|
||||
"o_wronly": &tengo.Int{Value: int64(os.O_WRONLY)},
|
||||
"o_rdwr": &tengo.Int{Value: int64(os.O_RDWR)},
|
||||
|
||||
17
vendor/github.com/d5/tengo/v2/vm.go
generated
vendored
17
vendor/github.com/d5/tengo/v2/vm.go
generated
vendored
@@ -218,30 +218,30 @@ func (v *VM) run() {
|
||||
return
|
||||
}
|
||||
case parser.OpJumpFalsy:
|
||||
v.ip += 2
|
||||
v.ip += 4
|
||||
v.sp--
|
||||
if v.stack[v.sp].IsFalsy() {
|
||||
pos := int(v.curInsts[v.ip]) | int(v.curInsts[v.ip-1])<<8
|
||||
pos := int(v.curInsts[v.ip]) | int(v.curInsts[v.ip-1])<<8 | int(v.curInsts[v.ip-2])<<16 | int(v.curInsts[v.ip-3])<<24
|
||||
v.ip = pos - 1
|
||||
}
|
||||
case parser.OpAndJump:
|
||||
v.ip += 2
|
||||
v.ip += 4
|
||||
if v.stack[v.sp-1].IsFalsy() {
|
||||
pos := int(v.curInsts[v.ip]) | int(v.curInsts[v.ip-1])<<8
|
||||
pos := int(v.curInsts[v.ip]) | int(v.curInsts[v.ip-1])<<8 | int(v.curInsts[v.ip-2])<<16 | int(v.curInsts[v.ip-3])<<24
|
||||
v.ip = pos - 1
|
||||
} else {
|
||||
v.sp--
|
||||
}
|
||||
case parser.OpOrJump:
|
||||
v.ip += 2
|
||||
v.ip += 4
|
||||
if v.stack[v.sp-1].IsFalsy() {
|
||||
v.sp--
|
||||
} else {
|
||||
pos := int(v.curInsts[v.ip]) | int(v.curInsts[v.ip-1])<<8
|
||||
pos := int(v.curInsts[v.ip]) | int(v.curInsts[v.ip-1])<<8 | int(v.curInsts[v.ip-2])<<16 | int(v.curInsts[v.ip-3])<<24
|
||||
v.ip = pos - 1
|
||||
}
|
||||
case parser.OpJump:
|
||||
pos := int(v.curInsts[v.ip+2]) | int(v.curInsts[v.ip+1])<<8
|
||||
pos := int(v.curInsts[v.ip+4]) | int(v.curInsts[v.ip+3])<<8 | int(v.curInsts[v.ip+2])<<16 | int(v.curInsts[v.ip+1])<<24
|
||||
v.ip = pos - 1
|
||||
case parser.OpSetGlobal:
|
||||
v.ip += 2
|
||||
@@ -534,6 +534,9 @@ func (v *VM) run() {
|
||||
}
|
||||
v.stack[v.sp] = val
|
||||
v.sp++
|
||||
default:
|
||||
v.err = fmt.Errorf("not indexable: %s", left.TypeName())
|
||||
return
|
||||
}
|
||||
case parser.OpCall:
|
||||
numArgs := int(v.curInsts[v.ip+1])
|
||||
|
||||
Reference in New Issue
Block a user