From a8436fca98afea55c13218f500545adec9d333bb Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Mon, 26 Aug 2019 00:30:26 +0200 Subject: Added semantic error class --- src/runMain/kotlin/Semantic.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/runMain/kotlin/Semantic.kt') 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) } } } -- cgit v1.2.3