Commit cbd2a79
authored
Improve error recovery in delimited groups when can't parse anything inside (#601)
Simpler variant of #594.
While writing an issue for the potential null parse recovery, it just
hit me that we might not need to support that generally but rather just
limiting that to the delimited group would give us enough bang for the
buck.
TerminatedBy null parse recovery can be a bit too greedy, i.e. we might
recover some unexpected item definition just because... we recovered at
the final terminator. However, the delimited group is a reasonable
boundary since it's simple (2-3 kinds of general delimiters versus
different kinds of potentially versioned terminated statements) and the
opening delimiter must always match the closing one, so it produces more
reliable and self-contained recovered phrases, hence attempting to
recover from a null parse in a delimited group makes more sense.1 parent 1a258c4 commit cbd2a79
12 files changed
Lines changed: 336 additions & 72 deletions
File tree
- .changeset
- crates
- codegen/parser
- generator/src
- runtime/src/support
- solidity
- outputs
- cargo/crate/src/generated
- support
- npm/crate/src/generated
- support
- testing/snapshots/cst_output/ContractDefinition/recovery_testbed/generated
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
190 | 191 | | |
191 | 192 | | |
192 | 193 | | |
| |||
256 | 257 | | |
257 | 258 | | |
258 | 259 | | |
| 260 | + | |
259 | 261 | | |
260 | 262 | | |
261 | 263 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
10 | 22 | | |
11 | 23 | | |
12 | 24 | | |
| |||
34 | 46 | | |
35 | 47 | | |
36 | 48 | | |
| 49 | + | |
37 | 50 | | |
38 | 51 | | |
39 | 52 | | |
| |||
47 | 60 | | |
48 | 61 | | |
49 | 62 | | |
50 | | - | |
51 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
52 | 75 | | |
53 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
54 | 80 | | |
55 | 81 | | |
56 | 82 | | |
| |||
61 | 87 | | |
62 | 88 | | |
63 | 89 | | |
64 | | - | |
| 90 | + | |
65 | 91 | | |
66 | 92 | | |
67 | 93 | | |
| |||
83 | 109 | | |
84 | 110 | | |
85 | 111 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
91 | 119 | | |
92 | 120 | | |
93 | 121 | | |
| |||
0 commit comments