about summary refs log tree commit diff
path: root/pkg/lang/vm/text/errors.go
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2022-05-18 01:37:09 +0200
committerMel <einebeere@gmail.com>2022-05-18 01:37:09 +0200
commit3abe18ffca484efc3553aa4ec9cb677eb19cdaf4 (patch)
tree15dfc5f349ca35ca150c88a3c1db4e43ab6c0320 /pkg/lang/vm/text/errors.go
parentec5ee8647bcbf6ab073711c6892710776925c54d (diff)
downloadjinx-3abe18ffca484efc3553aa4ec9cb677eb19cdaf4.tar.zst
jinx-3abe18ffca484efc3553aa4ec9cb677eb19cdaf4.zip
Create compiler for Lang bytecode assembly
Diffstat (limited to 'pkg/lang/vm/text/errors.go')
-rw-r--r--pkg/lang/vm/text/errors.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/pkg/lang/vm/text/errors.go b/pkg/lang/vm/text/errors.go
new file mode 100644
index 0000000..a734a61
--- /dev/null
+++ b/pkg/lang/vm/text/errors.go
@@ -0,0 +1,33 @@
+package text
+
+type ErrInvalidValue struct {
+	Value string
+}
+
+func (e ErrInvalidValue) Error() string {
+	return "invalid value: " + e.Value
+}
+
+type ErrDuplicateLabel struct {
+	Label string
+}
+
+func (e ErrDuplicateLabel) Error() string {
+	return "duplicate label: " + e.Label
+}
+
+type ErrUnkonwnLabel struct {
+	Label string
+}
+
+func (e ErrUnkonwnLabel) Error() string {
+	return "unknown label: " + e.Label
+}
+
+type ErrUnknownOp struct {
+	Op string
+}
+
+func (e ErrUnknownOp) Error() string {
+	return "unknown op: " + e.Op
+}