From 825c14a0c5e86cc2d33a3f70d3be846660d466f6 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 24 Dec 2020 23:30:42 +0900 Subject: Reset paren_nest at tAREF and tASET. --- mrbgems/mruby-compiler/core/parse.y | 1 + mrbgems/mruby-compiler/core/y.tab.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y index 16e1cef32..e4a3b9f28 100644 --- a/mrbgems/mruby-compiler/core/parse.y +++ b/mrbgems/mruby-compiler/core/parse.y @@ -5844,6 +5844,7 @@ parser_yylex(parser_state *p) p->paren_nest++; if (p->lstate == EXPR_FNAME || p->lstate == EXPR_DOT) { p->lstate = EXPR_ARG; + p->paren_nest--; if ((c = nextc(p)) == ']') { if ((c = nextc(p)) == '=') { return tASET; diff --git a/mrbgems/mruby-compiler/core/y.tab.c b/mrbgems/mruby-compiler/core/y.tab.c index 012f4a74e..920c56523 100644 --- a/mrbgems/mruby-compiler/core/y.tab.c +++ b/mrbgems/mruby-compiler/core/y.tab.c @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -11845,6 +11845,7 @@ parser_yylex(parser_state *p) p->paren_nest++; if (p->lstate == EXPR_FNAME || p->lstate == EXPR_DOT) { p->lstate = EXPR_ARG; + p->paren_nest--; if ((c = nextc(p)) == ']') { if ((c = nextc(p)) == '=') { return tASET; -- cgit v1.2.3