aboutsummaryrefslogtreecommitdiff
path: root/pkg/lang/vm/text
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2022-08-16 20:33:41 +0000
committerMel <einebeere@gmail.com>2022-08-16 20:33:41 +0000
commitd84c0f36afcde4e5af2907d70931de75957d5277 (patch)
tree9eb056ca70c6bedf0ee6456baa4c1f7251384463 /pkg/lang/vm/text
parent51eb7626b788dc031c53016f203a54a2af762d9e (diff)
downloadjinx-d84c0f36afcde4e5af2907d70931de75957d5277.tar.zst
jinx-d84c0f36afcde4e5af2907d70931de75957d5277.zip
Implement setting values at index in an array
Diffstat (limited to 'pkg/lang/vm/text')
-rw-r--r--pkg/lang/vm/text/decompiler.go1
-rw-r--r--pkg/lang/vm/text/op.go1
2 files changed, 2 insertions, 0 deletions
diff --git a/pkg/lang/vm/text/decompiler.go b/pkg/lang/vm/text/decompiler.go
index 8a85d49..df9e1ed 100644
--- a/pkg/lang/vm/text/decompiler.go
+++ b/pkg/lang/vm/text/decompiler.go
@@ -67,6 +67,7 @@ func (d *Decompiler) decompileInstruction(bc code.Raw) (string, code.Raw) {
code.OpLte,
code.OpGte,
code.OpIndex,
+ code.OpSetAtIndex,
code.OpRet,
code.OpTempArrLen,
code.OpTempArrPush:
diff --git a/pkg/lang/vm/text/op.go b/pkg/lang/vm/text/op.go
index ff3c568..213656b 100644
--- a/pkg/lang/vm/text/op.go
+++ b/pkg/lang/vm/text/op.go
@@ -40,6 +40,7 @@ var (
code.OpLte: "lte",
code.OpGte: "gte",
code.OpIndex: "index",
+ code.OpSetAtIndex: "set_at_index",
code.OpCall: "call",
code.OpJmp: "jmp",
code.OpJt: "jt",