Closed ariya closed 8 years ago
I'd prefer this behavior:
ast
option is false
(=default):
ast
is not there (undefined)ast
option is true
:
ast
is returned when the input is parsed successfully (syntactically correct)ast: false
ast
or buildAST
are both good names for that option .. I'll leave it up to you.
I'll adjust the implementation to match the proposed behavior.
Note that this new behavior (buildAst
is false
by default) is a breaking change. I can check and tweak cardinal (e.g. it assumes invalid code will throw an exception), but other downstream users might break.
Note that this new behavior (buildAst is false by default) is a breaking change
Yes I know, we'll publish a new major version.
Yes I know, we'll publish a new major version.
If you'd like a transition time (only a minor version update), we can do the following:
buildAst
to true
buildAst = false
That way, cardinal can benefit from this pure tokenizer mode while other downstream users have some time to evaluate and migrate.
Entirely up to you, I can live with or without the transition.
Let's go with breaking things as I think it's better in general to just use the tokenizer by default.
Let's go with breaking things as I think it's better in general to just use the tokenizer by default.
In that case, is there a strong reason to keep the AST mode?
Yes, since some people may want to build tools around this that use the AST, so let's not totally kill it.
@thlorenz Any review/comment on the latest commit?
Great work so far, just need to figure out those last tidbits. Thanks.
@thlorenz Do the added/tweaked tests look good now?
LGTM @ariya when you feel this is complete feel free to squash+merge to master and ping me please so I can version and publish.
@thlorenz Landed in master. Thank you!
Published as v1.0.0. Major upgrade due to breaking changes. Thanks for all the great work :)
What should be the option name and the default value?
ast
andfalse
as the defaut is OK for you?And I can update the docs accordingly.