-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect docs for parsing and unparsing #2
Comments
We removed the automatic parser-, but you can still define one using define-parser: (define-parser parse- ) I think of the auto generated parser and with-output-language as being for slightly different purposes. I use parse when I’m reading in a full program. I tend to use with-output-language when I’m ginning up bits of language form outside of the right-hand side of a pass body. When I get some spare time, I will update the docs accordingly. Since I’ve noticed you’ve commented more on this :) Kent and I made the strategic decision to make the asymmetric change of having define-parser be separate while define-unparsed is not, because we were basically never using the parsers for the Chez Scheme compiler. The parsers are too simple to really be useful inside a commercial compiler, but they are great for a teaching compiler. The unparsers, on the other hand, and useful for tracing and for error messages and almost always end up getting used. (In particular the trace-define-pass makes use of the unparsers, which is handy for debugging.) That said, there is actually a separate define-unparsed form as well, and you can define separate unparsers with it, if you wanted a different name, or something along those lines. -andy:) Section 2.3 claims that define-language produces a parser function parse- and an unparser unparse-, but I'm told that's not the case and to use with-output-language instead. This should be reflected in the docs. — |
I’m reading Nanopass’ documentation and I just tripped over the false claim that In other words, the implementation behaves like @akeep described in the comment above, of course. But the documentation doesn’t reflect that. |
I believe #21 fixes this. Should have referenced this issue in the Pull request, sorry. |
Section 2.3 claims that define-language produces a parser function
parse-<language-name>
and an unparserunparse-<language-name>
, but I'm told that's not the case and to usewith-output-language
instead. This should be reflected in the docs.The text was updated successfully, but these errors were encountered: