summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2011-08-05 11:30:11 +0100
committerFather Chrysostomos <sprout@cpan.org>2011-11-06 01:13:45 -0700
commit802a15e9c01d1a0b6bb74d5a6e5dcd9ee1a651a4 (patch)
tree811270446d0858e48ee5107d98ef0e9e680fe547 /toke.c
parentcda6b701e74e196d7908411ab7c4da684203869d (diff)
downloadperl-802a15e9c01d1a0b6bb74d5a6e5dcd9ee1a651a4.tar.gz
eval STRING UTF8 cleanup.
(modified by the committer only to apply when the unicode_eval feature is enabled)
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/toke.c b/toke.c
index aaeff85a27..43ca704cc9 100644
--- a/toke.c
+++ b/toke.c
@@ -133,7 +133,7 @@ static const char ident_too_long[] = "Identifier too long";
#ifdef USE_UTF8_SCRIPTS
# define UTF (!IN_BYTES)
#else
-# define UTF ((PL_linestr && DO_UTF8(PL_linestr)) || (PL_hints & HINT_UTF8))
+# define UTF ((PL_linestr && DO_UTF8(PL_linestr)) || ( !(PL_parser->lex_flags & LEX_IGNORE_UTF8_HINTS) && (PL_hints & HINT_UTF8)))
#endif
/* The maximum number of characters preceding the unrecognized one to display */
@@ -686,7 +686,7 @@ Perl_lex_start(pTHX_ SV *line, PerlIO *rsfp, U32 flags)
const char *s = NULL;
STRLEN len;
yy_parser *parser, *oparser;
- if (flags && flags != LEX_START_SAME_FILTER)
+ if (flags && flags & ~(LEX_START_SAME_FILTER|LEX_IGNORE_UTF8_HINTS))
Perl_croak(aTHX_ "Lexing code internal error (%s)", "lex_start");
/* create and initialise a parser */
@@ -743,6 +743,7 @@ Perl_lex_start(pTHX_ SV *line, PerlIO *rsfp, U32 flags)
parser->linestart = SvPVX(parser->linestr);
parser->bufend = parser->bufptr + SvCUR(parser->linestr);
parser->last_lop = parser->last_uni = NULL;
+ parser->lex_flags = flags & LEX_IGNORE_UTF8_HINTS;
parser->in_pod = 0;
}