Commit 500bb47 1 parent f1e105e commit 500bb47 Copy full SHA for 500bb47
File tree 2 files changed +58
-2
lines changed
2 files changed +58
-2
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ simple-statement {
111
111
112
112
Condition { expr _t? }
113
113
ElseIfClause { kw<'elseif'> Condition block? }
114
- CatchClause { kw<'catch'> block? } // TODO: ExceptionCapture
114
+ CatchClause { kw<'catch'> ExceptionCapture { !simple Identifier }? block? }
115
115
ElseClause { kw<'else'> block? }
116
116
FinallyClause{ kw<'finally'> block? }
117
117
Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ if true 1 else 0 end
219
219
220
220
if a
221
221
b()
222
- elseif c
222
+ elseif c
223
223
d()
224
224
d()
225
225
else
@@ -280,6 +280,16 @@ finally
280
280
close(resource)
281
281
end
282
282
283
+ try
284
+ catch e
285
+ e
286
+ end
287
+
288
+ try catch e e end
289
+ try catch e end
290
+ try catch end
291
+ try finally end
292
+
283
293
==>
284
294
Program(
285
295
TryStatement(
@@ -300,6 +310,52 @@ Program(
300
310
)
301
311
end
302
312
)
313
+ TryStatement(
314
+ try
315
+ CatchClause(
316
+ catch
317
+ ExceptionCapture(Identifier)
318
+ Identifier
319
+ )
320
+ end
321
+ )
322
+
323
+ TryStatement(
324
+ try
325
+ CatchClause(
326
+ catch
327
+ ExceptionCapture(Identifier)
328
+ Identifier
329
+ )
330
+ end
331
+ )
332
+
333
+ TryStatement(
334
+ try
335
+ CatchClause(
336
+ catch
337
+ ExceptionCapture(Identifier)
338
+ )
339
+ end
340
+ )
341
+
342
+ TryStatement(
343
+ try
344
+ CatchClause(
345
+ catch
346
+ )
347
+ end
348
+ )
349
+
350
+ TryStatement(
351
+ try
352
+ FinallyClause(
353
+ finally
354
+ )
355
+ end
356
+ )
357
+
358
+
303
359
)
304
360
305
361
You can’t perform that action at this time.
0 commit comments