From af17bd73e210f16c8947acb8119ff9e2d3c2f054 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Fri, 25 Apr 2014 20:06:54 +0200 Subject: don't abort on unexpected semicolon (break from loop) the question remains what to do then. FIXME: consult TECO standard --- src/parser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/parser.cpp') diff --git a/src/parser.cpp b/src/parser.cpp index d39d9ef..17a11b9 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -936,7 +936,9 @@ StateStart::custom(gchar chr) if (IS_FAILURE(rc)) { expressions.discard_args(); - g_assert(expressions.pop_op() == Expressions::OP_LOOP); + if (expressions.pop_op() != Expressions::OP_LOOP) + /* FIXME: what does standard teco say to this */ + throw Error("Cannot break from loop without loop"); expressions.pop_num(); /* pc */ expressions.pop_num(); /* counter */ -- cgit v1.2.3