From 3abe18ffca484efc3553aa4ec9cb677eb19cdaf4 Mon Sep 17 00:00:00 2001 From: Mel Date: Wed, 18 May 2022 01:37:09 +0200 Subject: Create compiler for Lang bytecode assembly --- pkg/lang/vm/text/errors.go | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 pkg/lang/vm/text/errors.go (limited to 'pkg/lang/vm/text/errors.go') 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 +} -- cgit 1.4.1