RESS
RESS copied to clipboard
Disambiguate optional chaining operator from ternary operator
not sure if skipping ahead and then skipping back is the best solution here
I think skipping ahead and then skipping back is really the only way in this case. Thinking through this particular part of the grammar there is one more thing we need to account for: whitespace.
The following are valid optional chains
let a = null
a?. b
a?. ()
a?. [3]
so I think just checking for the next char isn't going to be enough. Instead, it might make sense to test for that period being part of a Number. To do what, we should be able to use something like
if self.stream.at_decimal() {
// not optional chain
} else {
// optional chain
}
Sorry that I didn't see this issue when bringing up the ident_start option
You are right. Sorry, I forgot that there can be white spaces in between. I makes much more sense with checking for a decimal number with a dot in front.
One last nit: Can you squash the fmt
commit into Added tests for es2020 operators? then I can merge it and publish the new version
You want to do a new version despite missing support for the new operators for the non-spanned module? I will have a look at this as well. Just not sure when I got some time.
The resast wouldn't get published, just a new alpha version of ress that can be consumed by ressa to generate the resast changes you are working on.
sorry, the landscape here is a little confusing with all the different repositories. I have been thinking of trying to collapse them all into a single crate with feature gates but that seems like it would be particularly challenging.
ahh makes sense. Yes, its a little confusing, also with a lot of different branches. On the other side I do like the modularity :)
Squashed the commits