Commit cd143da
committed
fix(parser): make empty catch an incomplete.
When parsing a `TRY` if there is an empty catch block instead of just
returning a syntax error return an incomplete if you're at the EOF. This
ensures that in the REPL if you are in a position like:
```scala
scala> try {
| ???
| } catch
```
And you hit enter you'll still be able to continue.
Fixes #43931 parent 29f9d33 commit cd143da
File tree
2 files changed
+17
-1
lines changed- compiler
- src/dotty/tools/dotc/parsing
- test/dotty/tools/repl
2 files changed
+17
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
283 | 289 | | |
284 | 290 | | |
285 | 291 | | |
| |||
2003 | 2009 | | |
2004 | 2010 | | |
2005 | 2011 | | |
2006 | | - | |
| 2012 | + | |
2007 | 2013 | | |
2008 | 2014 | | |
2009 | 2015 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
303 | 313 | | |
0 commit comments