summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8fae966)
raw | patch | inline | side by side (parent: 8fae966)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 20 Mar 2014 07:36:54 +0000 (08:36 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Thu, 20 Mar 2014 07:36:54 +0000 (08:36 +0100) |
src/frontend/grammar.y | patch | blob | history |
diff --git a/src/frontend/grammar.y b/src/frontend/grammar.y
index f262f3e11d9ace504a2fa08dc4b3ef8bb7c9befe..551d1714d7a12cf86b64aea6834b4e4dd782dd89 100644 (file)
--- a/src/frontend/grammar.y
+++ b/src/frontend/grammar.y
statements:
statements ';' statement
{
+ /* only accept this in default parse mode */
+ if (parser_mode != SDB_PARSE_DEFAULT) {
+ sdb_fe_yyerror(&yylloc, scanner,
+ YY_("syntax error, unexpected statement, "
+ "expecting expression"));
+ YYABORT;
+ }
+
if ($3) {
sdb_llist_append(pt, SDB_OBJ($3));
sdb_object_deref(SDB_OBJ($3));
|
statement
{
+ /* only accept this in default parse mode */
+ if (parser_mode != SDB_PARSE_DEFAULT) {
+ sdb_fe_yyerror(&yylloc, scanner,
+ YY_("syntax error, unexpected statement, "
+ "expecting expression"));
+ YYABORT;
+ }
+
if ($1) {
sdb_llist_append(pt, SDB_OBJ($1));
sdb_object_deref(SDB_OBJ($1));