-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add new "verbose" mode #55
Comments
Verbose mode seems great, but I’m using node.kind quite a lot especially for "value" nodes, and I’m not too sure how to generate some values without using kind. |
@D10, if So yes, this is a little bit painful, but as raised by @mathiasbynens in #54 (comment), there is no free lunch: either modifying the AST is easier or regenerating it is easier. I do not see how we can have both at the same time. @D10, does that sounds reasonable to you? |
In that case there will be some conflicts such as controlLetter which returns a number from 1 to 26, which could be mistaken for the Unicode value U+0001. |
Yes, the generated RegExp is then no longer unique determined. The code to regenerate the AST has then to make a good choice. To ensure there is one unique output (and reading @mathiasbynens comment here #54 (comment) once more), I am happy to have two kind of
How does this sound? |
I dislike the idea of reserving
Two verbose modes sounds a bit excessive IMHO. At this point I’d prefer just a single verbose mode, that adds
That is not necessarily a bad thing, though. (Note that this is true for Escodegen to some extent.) |
This was brought up before and also arises in #54. The idea is to have a verbose mode, which splits out the current from of the AST. If the
verbose
mode is turned off, following properties are omitted from the AST:range
raw
kind
The current
parse
function accepts as second argumentflags
:to turn on
verbose
mode, I think theflags
string could just contain av
, like:Thoughts?
The text was updated successfully, but these errors were encountered: