xsawyerx / guacamole

Guacamole is a parser toolkit for Standard Perl. It provides fully static BNF-based parsing capability to a reasonable subset of Perl.
https://metacpan.org/pod/Guacamole
20 stars 8 forks source link

Quoting barewords with the negation operator not supported #109

Open haukex opened 3 years ago

haukex commented 3 years ago

For example, print -foo;, which would normally just print the string -foo, is not supported. If this is on purpose, it should probably be documented.

xsawyerx commented 3 years ago

We documented two relevant pieces:

I think it covered the above well. Do you think we should still explicitly mention this case?

haukex commented 3 years ago

I was a little off in the issue title, -bareword doesn't seem to be called "autoquoting" in the docs, since it's a special behavior of the negation operator, so it doesn't really fit in the standard.pm docs under "Auto-quoting", or under "Q-Like values delimiters". So I do think it would be good if it got a brief mention somewhere.

(An alternative but more radical change would be to reorganize the docs and put "Auto-quoting", "HEREDOCs", and "Q-Like values delimiters" in a new section "Strings". By the way, looking at the sections in the docs, aren't "constructs that the perl interpreter understands but that that Standard Perl does not support" and "limitations that Standard Perl has which the perl interpreter doesn't" kind of the same thing?)

xsawyerx commented 3 years ago

I was a little off in the issue title, -bareword doesn't seem to be called "autoquoting" in the docs, since it's a special behavior of the negation operator, so it doesn't really fit in the standard.pm docs under "Auto-quoting", or under "Q-Like values delimiters". So I do think it would be good if it got a brief mention somewhere.

We would be very happy to receive a documentation patch in the form you think is most readable and least confusing.

(An alternative but more radical change would be to reorganize the docs and put "Auto-quoting", "HEREDOCs", and "Q-Like values delimiters" in a new section "Strings".

Not a bad idea. Would you be able to create a PR for this?

By the way, looking at the sections in the docs, aren't "constructs that the perl interpreter understands but that that Standard Perl does not support" and "limitations that Standard Perl has which the perl interpreter doesn't" kind of the same thing?)

They are similar, that is true. Maybe they should also be merged.

The idea was that the former is about things Standard Perl does not understand and the latter is situations in which Standard Perl purposefully prefers to not recoginize. It also refers to what Perl wants to support versus additional lee-way it gives the user.

I agree these differences might not be significant enough to separate to two parts. Documentation patch on this would also be welcomed. :)