-
Notifications
You must be signed in to change notification settings - Fork 65
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
Document the error.format() method - how is this supposed to work? #384
Comments
This is because
Literally, this is an identifier, like
Locations in generated errors can have different
It contains positions in some input, but not the input itself. To show you pretty printed error with a part of the input you should provide it somehow. |
Does #382 fix this adequately for you yet? |
Addresses peggyjs#384 by adding clarifying descriptions and uses example strings to make it more obvious what the source mapping does.
@Mingun ah that makes sense. The array thing confused me. Your reply gave me enough information to open https://github.com/peggyjs/peggy/pull/389/files |
Addresses peggyjs#384 by adding clarifying descriptions and uses example strings to make it more obvious what the source mapping does.
Fixed in #389 |
The documentation says:
What does this mean? What is a mapping from source to grammar? Why is it an array?
lib/peg.d.ts
saysWhat does this mean? What is an "identifier of a grammar"?
Why does format require an array argument? Doesn't it already have error location information, and source lexeme information, to generate a useful error message?
It doesn't for me, and I'm not sure how it's supposed to work.
This logs:
Which doesn't have any of the
^^^^^
/-->
ASCII arrows promised in the documentation.I'd like to update the documentation on this function as well, but I'm not yet sure what the API is trying to convey.
The text was updated successfully, but these errors were encountered: