#56: added error case in preprocess()

This commit is contained in:
Louis Rubet 2017-05-20 22:31:58 +02:00
parent 3b72e9d714
commit 201966fe2e

View file

@ -574,8 +574,17 @@ public:
//fill 'end' branch of 'else'
((branch*)seq_obj(vlayout[layout_index].index_else))->arg2 = i;
else
{
//fill 'end' branch of 'then'
if (vlayout[layout_index].index_then != -1)
((branch*)seq_obj(vlayout[layout_index].index_then))->arg2 = i;
else
{
// error: show it
show_syntax_error("missing then before end");
return ret_syntax;
}
}
layout_index--;
}
}