Skip to content

Commit 29e3bc2

Browse files
committed
refactor!: simplify exceptions
1 parent d8f9e69 commit 29e3bc2

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

grammar.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -354,13 +354,14 @@ module.exports = grammar({
354354
'try',
355355
':',
356356
field('body', $._suite),
357-
repeat(choice($.except_clause, $.except_group_clause)),
357+
repeat($.except_clause),
358358
optional($.else_clause),
359359
optional($.finally_clause),
360360
),
361361

362362
except_clause: $ => seq(
363363
'except',
364+
optional('*'),
364365
optional(seq(
365366
field('value', $.expression),
366367
optional(seq(
@@ -372,19 +373,6 @@ module.exports = grammar({
372373
$._suite,
373374
),
374375

375-
except_group_clause: $ => seq(
376-
'except*',
377-
seq(
378-
$.expression,
379-
optional(seq(
380-
'as',
381-
$.expression,
382-
)),
383-
),
384-
':',
385-
$._suite,
386-
),
387-
388376
finally_clause: $ => seq(
389377
'finally',
390378
':',

0 commit comments

Comments
 (0)