diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-07-22 18:33:38 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-07-22 18:33:38 -0400 |
commit | 485f6c2b0f3c69c94458b67c797e4d4eb63c6c3e (patch) | |
tree | 2a654e44a90f40d0d514c3d6005155281a42a4da /Keyword.xs | |
parent | 0cdc63eb4e5b7357b40ee7b43b1299208c375e10 (diff) | |
download | parse-keyword-485f6c2b0f3c69c94458b67c797e4d4eb63c6c3e.tar.gz parse-keyword-485f6c2b0f3c69c94458b67c797e4d4eb63c6c3e.zip |
work around bugs in lex_next_chunk
Diffstat (limited to 'Keyword.xs')
-rw-r--r-- | Keyword.xs | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -95,14 +95,29 @@ lex_peek(len = 1) UV len CODE: PL_curcop = &PL_compiling; + + /* XXX before 5.19.2, lex_next_chunk when we aren't at the end of a line + * just breaks things entirely (the parser no longer sees the text that is + * read in). this is (i think inadvertently) fixed in 5.19.2 (21791330a), + * but it still screws up the line numbers of everything that follows. so, + * the workaround is just to not call lex_next_chunk unless we're at the + * end of a line. this is a bit limiting, but should rarely come up in + * practice. + */ + /* while (PL_parser->bufend - PL_parser->bufptr < len) { if (!lex_next_chunk(0)) { break; } } + */ + if (PL_parser->bufptr == PL_parser->bufend) { + lex_next_chunk(0); + } if (PL_parser->bufend - PL_parser->bufptr < len) { len = PL_parser->bufend - PL_parser->bufptr; } + RETVAL = newSVpvn(PL_parser->bufptr, len); /* XXX unicode? */ OUTPUT: RETVAL |