Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^4: poll ideas quest 2021

by haukex (Archbishop)
on Aug 18, 2021 at 08:19 UTC ( [id://11135914]=note: print w/replies, xml ) Need Help??


in reply to Re^3: poll ideas quest 2021
in thread poll ideas quest 2021

Guacamole

I think it's noteworthy that the goal of that module is not to be able to parse all of Perl, just the subset of "standard Perl". So for example, it doesn't allow -bareword, stringy eval, unquoted hash keys on the left of the fat comma, and several more, but not because of technical limitations of the parser, but for policy reasons. I've suggested that the technical and policy based restrictions be disentangled to allow for easier porting of codebases to a parseable Perl, but I'm currently not sure when or if that might happen.

Of course also noteworthy is RPerl, which I believe implements its own parser.

Replies are listed 'Best First'.
Re^5: poll ideas quest 2021
by hippo (Bishop) on Aug 18, 2021 at 08:32 UTC
    unquoted hash keys on the left of the fat comma

    That will rule out a lot of the Perl I read and pretty much all of the Perl I write. If that's a policy restriction rather than a technical one then I am at a loss to understand the reasoning behind it.


    🦛

      That will rule out a lot of the Perl I read and pretty much all of the Perl I write.

      Yes, same here, and I commented on that in the issue I linked to above and Sawyer responded here. It doesn't seem to be a technical limitation.

      Since I think it would be technically possible to parse something like my %hash = ( foo => -bar );, that also means that it would be possible to automatically transform that to my %hash = ( 'foo' => '-bar' );, for example if that's what the company coding standards happen to be. Update: However, the transformation requires a completely parseable Perl in the first place, which is what we don't have (yet).

        I think the problem with -bar is that it is difficult to disambiguate between the expression '-' bareword and '-bareword' as a single token. Maybe you can fix that by post-processing the generated tree, but my impression is that Sawyer wanted to avoid any "special" logic and have a purely EBNF-driven approach.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11135914]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2024-04-24 23:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found