# New Ticket Created by  Kevin Polulak 
# Please include the string:  [perl #101562]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=101562 >


I stumbled across a bug where `perl6 --doc` fails to parse the file if it
contains inline PIR. Not just any inline PIR, only PIR that calls the
'find_lex' opcode within a method.

Consider the following code:

    =begin pod

    Some text

    =end pod

    class Foo;

    method foobar() {
        my $string := 'Why does POD6 hate me so much?';

        Q:PIR {
            $P0 = find_lex '$string'
        };
    }

Running `perl6 --doc` gives a lovely IMCC error:

    Use of uninitialized value in string context
    Use of uninitialized value in string context
    ===SORRY!===
    error:imcc:syntax error, unexpected '\n'
        in file '(file unknown)' line 242

The "unexpected" character can vary sometimes. If I add:

    self = new $P0

after the call to 'find_lex', I get two "unexpected" characters:

    error:imcc:syntax error, unexpected '=', expecting '(' ('=')
        in file '(file unknown)' line 253
    error:imcc:syntax error, unexpected '\n'
        in file '(file unknown)' line 256

It's only under those conditions though: only with the 'find_lex' opcode and
only inside a method definition. I can't understand why any non-pod text
after an `=end pod` would affect the rendering of POD.

-- 
- Kevin Polulak (soh_cah_toa)

Reply via email to