Make the parser’s ‘expected <foo>, found <bar>’ errors more accurate
As an example of what this changes, the following code: let x: [int ..4]; Currently spits out ‘expected `]`, found `..`’. However, a comma would also be valid there, as would a number of other tokens. This change adjusts the parser to produce more accurate errors, so that that example now produces ‘expected one of `(`, `+`, `,`, `::`, or `]`, found `..`’.
This commit is contained in:
parent
3a325c666d
commit
108bca53f0
29 changed files with 155 additions and 95 deletions
|
@ -8,4 +8,4 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
type v = [int * 3]; //~ ERROR expected `]`, found `*`
|
||||
type v = [int * 3]; //~ ERROR expected one of `(`, `+`, `,`, `::`, or `]`, found `*`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue