diff options
author | Tony Cook <tony@develop-help.com> | 2019-02-12 16:30:34 +1100 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2019-06-12 11:05:15 +1000 |
commit | 69afcc21edd23e38a4aff806a14e666d77f2bd0c (patch) | |
tree | 9ac7a8fd30dfc1139dd2bd38782e00ecb791751e /perly.h | |
parent | 2dd5ef160d2c5f016b80d7946dbd60cd03f7827e (diff) | |
download | perl-69afcc21edd23e38a4aff806a14e666d77f2bd0c.tar.gz |
(perl #130585) prevent a spurious ) in a subparse confusing the parser
When doing a subparse, the tokenizer opens up the subexpression
with a '(' token, expecting the logic in yylex() to generate a ')'
once it sees the end of the subparsed string.
If the subparsed string includes an unmatched ')', this could confuse
the parser into finishing the expression and effectively exiting the
subparse without cleaning up (including popping the context)
To avoid that, create special bracketing tokens only generated for
a subparse and update the grammar to use those tokens in the cases
they might be used in a subparse.
This is an updated version of the patch that moves the FUNC rule
to where the original rule was and adds a test for non-regexp
subparses.
Diffstat (limited to 'perly.h')
-rw-r--r-- | perly.h | 52 |
1 files changed, 27 insertions, 25 deletions
@@ -7,11 +7,11 @@ #define PERL_BISON_VERSION 30000 #ifdef PERL_CORE -/* A Bison parser, made by GNU Bison 3.0.5. */ +/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -112,28 +112,30 @@ extern int yydebug; COLONATTR = 315, FORMLBRACK = 316, FORMRBRACK = 317, - PREC_LOW = 318, - OROP = 319, - DOROP = 320, - ANDOP = 321, - NOTOP = 322, - ASSIGNOP = 323, - OROR = 324, - DORDOR = 325, - ANDAND = 326, - BITOROP = 327, - BITANDOP = 328, - SHIFTOP = 329, - MATCHOP = 330, - UMINUS = 331, - REFGEN = 332, - POWOP = 333, - PREINC = 334, - PREDEC = 335, - POSTINC = 336, - POSTDEC = 337, - POSTJOIN = 338, - ARROW = 339 + SUBLEXSTART = 318, + SUBLEXEND = 319, + PREC_LOW = 320, + OROP = 321, + DOROP = 322, + ANDOP = 323, + NOTOP = 324, + ASSIGNOP = 325, + OROR = 326, + DORDOR = 327, + ANDAND = 328, + BITOROP = 329, + BITANDOP = 330, + SHIFTOP = 331, + MATCHOP = 332, + UMINUS = 333, + REFGEN = 334, + POWOP = 335, + PREINC = 336, + PREDEC = 337, + POSTINC = 338, + POSTDEC = 339, + POSTJOIN = 340, + ARROW = 341 }; #endif @@ -186,6 +188,6 @@ int yyparse (void); /* Generated from: - * 7aa97cfabf5b87a95ed263373e76c7af6d7e075e83d12e84ccdca9690c15a68d perly.y + * 41d458c12a47d69d8ab1315970582b2055ecea77bfc8a582b557e9b3df1c290a perly.y * b6fae5748f9bef6db4740aa5e122b84ac5181852d42474d0ecad621fa4253306 regen_perly.pl * ex: set ro: */ |