On Mon, Apr 8, 2013 at 4:25 PM, Chris Nighswonger <
cnighswon...@foundations.edu> wrote:

> On Mon, Apr 8, 2013 at 3:14 PM, Stefan Seifert <n...@detonation.org>wrote:
>
>> I've never used DATA file handles in Perl much less with Inline::Python,
>> so
>> I'm not exactly sure. But the debug output looks like the Python source
>> code
>> ends at __version__. So I guess, the code reading the DATA file processes
>> everything from __Python__ to the next marker and treats every word
>> enclosed
>> in double underscores as such marker.
>>
>
>

So it does look as though the DATA splitting algorithm is a bit "loose."

In Inline.pm abt line 354:

    @{$DATA{$pkg}} = split /(?m)(__\S+?__\n)/, $data;
    shift @{$DATA{$pkg}} unless ($ {$DATA{$pkg}}[0] || '') =~ /__\S+?__\n/;
    }

It appears we split on anything prefixed and suffixed with double
underscores.

Assuming that I'm not way off here:

I'm guessing that this is because we really don't know whether this is C,
Java, Python, or FooBar?

Can we have the language extension pass in what it is and actually search
for that marker rather than for __ANYTHING__?

Could we actually check for some specific end-of-code-block maker? Say
'__EOI__' for "end-of-inline" or some such?

Kind Regards,
Chris

Reply via email to