aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/com
diff options
context:
space:
mode:
authorjantuomi <jans.tuomi@gmail.com>2016-08-03 09:09:15 +0300
committerjantuomi <jans.tuomi@gmail.com>2016-08-03 09:54:46 +0300
commitf3b8e894c1212e0c494601d2ef04f94e4ee1ae7d (patch)
treedd3bdd4b40132be02d0095fc617770fc5de0eb8a /src/main/com
parenta8ac69d4c0e82ff4c8da7bf608b41c07afe1fc0e (diff)
Change "Malformed syntax tree" error to SyntaxError
Remove dead code Change SyntaxError message
Diffstat (limited to 'src/main/com')
-rw-r--r--src/main/com/jantuomi/tunkki/core/parser/ASTGenerator.java3
-rw-r--r--src/main/com/jantuomi/tunkki/core/runtime/Interpreter.java1
-rw-r--r--src/main/com/jantuomi/tunkki/exception/types/SyntaxTunkkiError.java2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/main/com/jantuomi/tunkki/core/parser/ASTGenerator.java b/src/main/com/jantuomi/tunkki/core/parser/ASTGenerator.java
index 7d8e231..d1221df 100644
--- a/src/main/com/jantuomi/tunkki/core/parser/ASTGenerator.java
+++ b/src/main/com/jantuomi/tunkki/core/parser/ASTGenerator.java
@@ -3,6 +3,7 @@ package com.jantuomi.tunkki.core.parser;
import com.jantuomi.tunkki.core.parser.ast.ASTNode;
import com.jantuomi.tunkki.core.parser.tokenizer.token.Token;
import com.jantuomi.tunkki.exception.types.GeneralTunkkiError;
+import com.jantuomi.tunkki.exception.types.SyntaxTunkkiError;
import com.jantuomi.tunkki.exception.types.TunkkiError;
import java.util.ArrayList;
@@ -35,7 +36,7 @@ public class ASTGenerator {
try {
root.print(0);
} catch (NullPointerException ex) {
- throw new GeneralTunkkiError(-1, "Malformed syntax tree.");
+ throw new SyntaxTunkkiError(-1, "Illegal syntax.");
}
System.out.println("### AST Tree end ###");
diff --git a/src/main/com/jantuomi/tunkki/core/runtime/Interpreter.java b/src/main/com/jantuomi/tunkki/core/runtime/Interpreter.java
index ef9a2c6..e9ee999 100644
--- a/src/main/com/jantuomi/tunkki/core/runtime/Interpreter.java
+++ b/src/main/com/jantuomi/tunkki/core/runtime/Interpreter.java
@@ -28,7 +28,6 @@ public class Interpreter {
}
catch (NullPointerException ex) {
continue;
- //throw new TunkkiError(TunkkiError.ExceptionType.GeneralError, -1, "Malformed input.");
}
if (data != null) {
diff --git a/src/main/com/jantuomi/tunkki/exception/types/SyntaxTunkkiError.java b/src/main/com/jantuomi/tunkki/exception/types/SyntaxTunkkiError.java
index 08d230b..fce4ef5 100644
--- a/src/main/com/jantuomi/tunkki/exception/types/SyntaxTunkkiError.java
+++ b/src/main/com/jantuomi/tunkki/exception/types/SyntaxTunkkiError.java
@@ -10,7 +10,7 @@ public class SyntaxTunkkiError extends TunkkiError {
@Override
public String what() {
- return "Unexpected %s.";
+ return "%s";
}
@Override