aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index 90447d4..0b11721 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -145,6 +145,7 @@ Execute::macro(const gchar *macro, bool locals)
try {
step(macro, strlen(macro));
+
if (Goto::skip_label) {
Error error("Label \"%s\" not found",
Goto::skip_label);
@@ -153,6 +154,18 @@ Execute::macro(const gchar *macro, bool locals)
error.line, error.column);
throw error;
}
+
+ if (States::current != &States::start) {
+ Error error("Unterminated command");
+ /*
+ * can only happen if we returned because
+ * of macro end
+ */
+ error.pos = strlen(macro);
+ String::get_coord(macro, error.pos,
+ error.line, error.column);
+ throw error;
+ }
} catch (...) {
g_free(Goto::skip_label);
Goto::skip_label = NULL;