Closed AndrewRayCode closed 1 year ago
Will review tomorrow. There are likely lots of doc changes needed, including splitting things up into multiple pages.
This looks good to me. Can also you please add yourself to the AUTHORS file if you're not already in there?
Done. Also I just realized the name of this flag is confusing, or am I missing something? grammarSource
- this makes me think it's the source of the .pegjs
file, rather than the input/lexemes being parsed. Is this the right flag name?
Edit: I think my confusion is because grammarSource
is reused between parse
and generate
. It should probably have a different name for parse
?
It has the same name for those two things because it's the same generated code. It's confusing, I'll grant you, but the grammar you write is input into the grammar at src/parser.pegjs
.
When reading
grammarSource
, I was pretty confused. This PR does a few things:grammarSource
is, because I originally thought it was supposed to be a duplicate of the source codegrammarSource
inLocations
I don't think it's unreasonable to say the documentation needs a rewrite. The original Peg.js documentation leaves a lot to be desired. This is my first attempt at making a confusing documentation entry more approachable.