Skip to content

Commit

Permalink
Add support for folded try, catch, catch_all, delegate instructions.
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark committed Feb 24, 2023
1 parent 7149e5d commit 5504835
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions wast.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,58 @@ contexts:
- instructions_folded
- resulttype
- label
- match: '(\(){{WHITES}}*(try){{IDTERM}}'
captures:
1: punctuation.definition.block.begin.wast
2: keyword.control.flow.wast
push:
- - meta_scope: meta.s-expression.instruction.wast
- match: '\)'
scope: punctuation.definition.block.end.wast
pop: true
- match: '(\(){{WHITES}}*(do){{IDTERM}}'
captures:
1: punctuation.definition.block.begin.wast
2: keyword.control.flow.wast
push:
- - meta_scope: meta.s-expression.instruction.wast
- match: '\)'
scope: punctuation.definition.block.end.wast
pop: true
- instructions
- match: '(\(){{WHITES}}*(delegate){{IDTERM}}'
captures:
1: punctuation.definition.block.begin.wast
2: keyword.control.flow.wast
push:
- - meta_scope: meta.s-expression.instruction.wast
- match: '\)'
scope: punctuation.definition.block.end.wast
pop: true
- reference
- match: '(\(){{WHITES}}*(catch){{IDTERM}}'
captures:
1: punctuation.definition.block.begin.wast
2: keyword.control.flow.wast
push:
- - meta_scope: meta.s-expression.instruction.wast
- match: '\)'
scope: punctuation.definition.block.end.wast
pop: true
- instructions
- reference
- match: '(\(){{WHITES}}*(catch_all){{IDTERM}}'
captures:
1: punctuation.definition.block.begin.wast
2: keyword.control.flow.wast
push:
- - meta_scope: meta.s-expression.instruction.wast
- match: '\)'
scope: punctuation.definition.block.end.wast
pop: true
- instructions
- resulttype
- label
# The lookahead here is a hack for if-then to avoid more copypasta contexts
- match: '\((?!{{WHITES}}*then{{IDTERM}})'
scope: punctuation.definition.instruction.begin.wast
Expand Down

0 comments on commit 5504835

Please sign in to comment.