aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/com/jantuomi/tunkki/exception
diff options
context:
space:
mode:
authorjantuomi <jans.tuomi@gmail.com>2016-08-29 15:28:45 +0300
committerjantuomi <jans.tuomi@gmail.com>2016-08-29 15:28:45 +0300
commitab048875e8f9b4861221c32751c5e503b3cafcb6 (patch)
tree5fc456de2222678476257a501c003e7b70bcad0b /src/main/com/jantuomi/tunkki/exception
parentc561978dbc9612c3726ef02b8c08ec296e05e23d (diff)
Implement 'new' keyword for object instantiation
Add NotAPrototypeError
Diffstat (limited to 'src/main/com/jantuomi/tunkki/exception')
-rw-r--r--src/main/com/jantuomi/tunkki/exception/types/NotAPrototypeTunkkiError.java20
-rw-r--r--src/main/com/jantuomi/tunkki/exception/types/TunkkiError.java3
2 files changed, 22 insertions, 1 deletions
diff --git a/src/main/com/jantuomi/tunkki/exception/types/NotAPrototypeTunkkiError.java b/src/main/com/jantuomi/tunkki/exception/types/NotAPrototypeTunkkiError.java
new file mode 100644
index 0000000..db351bb
--- /dev/null
+++ b/src/main/com/jantuomi/tunkki/exception/types/NotAPrototypeTunkkiError.java
@@ -0,0 +1,20 @@
+package com.jantuomi.tunkki.exception.types;
+
+/**
+ * Created by jan on 29.8.2016.
+ */
+public class NotAPrototypeTunkkiError extends TunkkiError {
+ public NotAPrototypeTunkkiError(int line, String... args) {
+ super(line, args);
+ }
+
+ @Override
+ public String what() {
+ return "Symbol %s is not an object prototype.";
+ }
+
+ @Override
+ ExceptionType getType() {
+ return ExceptionType.NotAPrototypeError;
+ }
+}
diff --git a/src/main/com/jantuomi/tunkki/exception/types/TunkkiError.java b/src/main/com/jantuomi/tunkki/exception/types/TunkkiError.java
index dfef1cf..3bc4186 100644
--- a/src/main/com/jantuomi/tunkki/exception/types/TunkkiError.java
+++ b/src/main/com/jantuomi/tunkki/exception/types/TunkkiError.java
@@ -27,7 +27,8 @@ abstract public class TunkkiError extends Exception {
FileNotFoundError,
NotAnObjectError,
MissingTerminatorTokenError,
- NadaError
+ NadaError,
+ NotAPrototypeError
}
private int line;