aboutsummaryrefslogtreecommitdiff
path: root/src/runMain/kotlin/Semantic.kt
diff options
context:
space:
mode:
authorMarvin Borner2019-08-26 00:30:26 +0200
committerMarvin Borner2019-08-26 00:30:26 +0200
commita8436fca98afea55c13218f500545adec9d333bb (patch)
tree291dd120b40933286af9aab754d371f1bb3b0845 /src/runMain/kotlin/Semantic.kt
parentd9f3c4329e8cf4de1435c6390a44f3a8399cfd3d (diff)
Added semantic error class
Diffstat (limited to 'src/runMain/kotlin/Semantic.kt')
-rw-r--r--src/runMain/kotlin/Semantic.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/runMain/kotlin/Semantic.kt b/src/runMain/kotlin/Semantic.kt
index b903f84..dc835d3 100644
--- a/src/runMain/kotlin/Semantic.kt
+++ b/src/runMain/kotlin/Semantic.kt
@@ -1,4 +1,5 @@
import TokenType.*
+import exceptions.*
class Semantic {
/**
@@ -16,7 +17,7 @@ class Semantic {
for (token in statement) {
if (token.type == Variable && token.content !in variables) {
- throw Exception("Undeclared variable")
+ throw SemanticError("Undeclared variable", token.content)
}
}
}