diff options
author | Serguey Parkhomovsky <sergueyparkhomovsky@gmail.com> | 2015-11-30 19:27:32 -0500 |
---|---|---|
committer | Will Estes <westes575@gmail.com> | 2015-11-30 19:33:32 -0500 |
commit | 9ba6e5283efd2fe454d3bc92eca960b3ebd91294 (patch) | |
tree | 1458e138661764db2e73a31e9b8a1db4a00622bf | |
parent | f1d53eb001bf3610b4935cb2fcd5c5363a921f28 (diff) |
Error on unbalanced parentheses in rules section.
-rw-r--r-- | src/scan.l | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -738,7 +738,13 @@ nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */ return '('; } "(" sf_push(); return '('; - ")" sf_pop(); return ')'; + ")" { + if (_sf_top_ix > 0) { + sf_pop(); + return ')'; + } else + synerr(_("unbalanced parenthesis")); + } [/|*+?.(){}] return (unsigned char) yytext[0]; . RETURNCHAR; |