diff options
author | Brian Fraser <fraserbn@gmail.com> | 2011-08-05 11:30:11 +0100 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-11-06 01:13:45 -0700 |
commit | 802a15e9c01d1a0b6bb74d5a6e5dcd9ee1a651a4 (patch) | |
tree | 811270446d0858e48ee5107d98ef0e9e680fe547 /toke.c | |
parent | cda6b701e74e196d7908411ab7c4da684203869d (diff) | |
download | perl-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.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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; } |