Skip to content

Conversation

@dcodeIO
Copy link
Member

@dcodeIO dcodeIO commented Feb 5, 2020

This fixes quite a bit of unnecessary diagnostic noise related to INVALID tokens, based on the example given by @MaxGraey :

export function getSpooky<👻>(): string {
    return "boo";
}

In particular, if an INVALID token is seen and is part of a surrogate pair, the entire pair will be skipped instead of emitting two diagnostics. Also, the tokenizer now implicitly skips over invalid tokens aiding the parser. There's already a diagnostic anyway. Also fixes a bug in the parser emitting null on empty type parameter lists, which sometimes resulted in reparsing something that already emitted a diagnostic.

In the example above, this now results in 2 errors (invalid character, empty type parameter list) instead of spooky 13.

@dcodeIO dcodeIO merged commit e6d6cb9 into master Feb 8, 2020
@dcodeIO dcodeIO deleted the invalidtoken branch February 8, 2020 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants