Skip to content

Commit

Permalink
fix break in try catch syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
itchyny committed Nov 26, 2022
1 parent 35c123b commit 62ffdf7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cli/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3177,6 +3177,13 @@
3
6
- name: label and break in try catch syntax
args:
- 'label $x | (label $y | try break $y catch .), .'
input: '10'
expected: |
10
- name: label and break in function argument
args:
- 'range(.) | label $out | limit(3; 1, if . > 1 then break $out end, 2)'
Expand Down
2 changes: 2 additions & 0 deletions execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ loop:
case *tryEndError:
err = er.err
break loop
case *breakError:
break loop
case ValueError:
if er, ok := er.(*exitCodeError); ok && er.halt {
break loop
Expand Down

0 comments on commit 62ffdf7

Please sign in to comment.