Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I'm almost certain there is enough information in place in the PPI tree to catch the two cases you want (incomplete regex and incomplete strings, plus you forgot incomplete heredocs, which PPI already detects in ->serialize).
    • Great! I'll have a look soon. I suspected there wasn't because I didn't see anything like the '???' of incomplete structures in the output of PPI::Dumper.
      • It's a little more complex and slightly different in each case, but as an example, look at the exact numbers in the Perl structure of an incomplete quote, you can probably intuit it.

        What might be a better idea though, is to introduce an ->complete or ->incomplete method at the PPI::Element level and abstract the entire thing behind a nice interface.

        • What might be a better idea though, is to introduce an ->complete or ->incomplete method at the PPI::Element level and abstract the entire thing behind a nice interface.

          That would be great. I've taken a stab at implementing it and it looks to be way over my head.