From 485f6c2b0f3c69c94458b67c797e4d4eb63c6c3e Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 22 Jul 2013 18:33:38 -0400 Subject: work around bugs in lex_next_chunk --- lib/Parse/Keyword.pm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Parse/Keyword.pm b/lib/Parse/Keyword.pm index afb2079..78a580a 100644 --- a/lib/Parse/Keyword.pm +++ b/lib/Parse/Keyword.pm @@ -73,6 +73,12 @@ current position in the buffer to be parsed is not moved. See L<< perlapi/PL_parser->linestr >> and L for more information. +NOTE: This function currently only returns text that is on the current line, +unless the current line has been fully read (via C). This is due to a +bug in perl itself, and this restriction will hopefully be lifted in a future +version of this module, so don't depend on it. See the L section for +more information. + =func lex_read($n) Moves the current position in the parsing buffer forward by C<$n> characters @@ -147,7 +153,15 @@ sub import { =head1 BUGS -This module inherits the limitation from L that custom +Peeking into the next line is currently (as of 5.19.2) broken in perl if the +current line hasn't been fully consumed. This module works around this by just +not doing that. This shouldn't be an issue for the most part, since it will +only come up if you need to conditionally parse something based on a token that +can span multiple lines. Just keep in mind that if you're reading in a large +chunk of text, you'll need to alternate between calling C and +C, or else you'll only be able to see text on the current line. + +This module also inherits the limitation from L that custom parsing is only triggered if the keyword is called by its unqualified name (C, not C, for instance). -- cgit v1.2.3-54-g00ecf