-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Support for correct PEG syntax #49
Comments
Hi @jontxu. I don't remember why I choose to change the syntax slightly. I guess it was due to making it more familiar to people used to C-like languages. Anyway, it is very easy to provide different syntaxes in Arpeggio. I wouldn't introduce backward incompatible changes in the existing grammars but I'm open to adding new syntaxes. It would be very easy to provide e.g. |
Could it be that v1.9.0 has switched to EDIT: I misread the issue starter post, so using |
@schmittlauch You are right. Thanks. Comments in cleanpeg indeed changed in d80127d (released in 1.8.0) due to introduction of unordered group operator which uses So, both variant of PEG uses @jontxu So the |
@jontxu To support original PEG in your grammar you could use cleanpeg parser and do grammar = orig_peg_grammar.replace('<-', '=').replace('#', '//')
parser = ParserPEG(grammar) |
Hello @igordejanovic, sorry for the delay on the reply. I think that this solution works by the time being but I think a |
Hello,
I have been using Arpeggio as a tool to test a grammar (re)written in PEG recently. It's a really good tool (a bit hard to understand the debugging output sometimes), but I found out that it doesn't really use the syntax defined on the original PEG paper by Bryan Ford.
The main differences are the use of
#
instead of//
for comments and the lack of semicolon for rule endings. I've seen that there is also a clean PEG alternative which doesn't follow the actual syntax (uses=
instead of<-
, as far as I know).I understand that using the semicolon is much simpler that not using it when parsing PEG itself, but is there any reason behind the decision? Are there any plans to support the correct PEG syntax? It doesn't deviate much from the norm, so I think doing it might be a good idea.
Thanks in advance.
The text was updated successfully, but these errors were encountered: