From ab69ecd2896d53d37f1f9120e36eead7fae3bcdc Mon Sep 17 00:00:00 2001 From: Catherine Date: Fri, 24 Feb 2023 06:33:52 +0000 Subject: [PATCH] Add support for pop instruction. It's not strictly limited to exception handling but is currently only necessary in catch blocks. --- wast.sublime-syntax | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/wast.sublime-syntax b/wast.sublime-syntax index ecbdd1f..4016aaa 100644 --- a/wast.sublime-syntax +++ b/wast.sublime-syntax @@ -396,6 +396,21 @@ contexts: - instructions - resulttype - label + - match: '(\(){{WHITES}}*(pop){{IDTERM}}' + captures: + 1: punctuation.definition.instruction.begin.wast + 2: support.function.numeric.wast + push: + - - meta_scope: meta.s-expression.instruction.wast + - match: '\)' + scope: punctuation.definition.instruction.end.wast + pop: true + - match: '.' + scope: invalid.illegal.wast + - - match: '{{VALTYP}}' + scope: support.type.wast + - match: '(?=.)' + pop: true # The lookahead here is a hack for if-then to avoid more copypasta contexts - match: '\((?!{{WHITES}}*then{{IDTERM}})' scope: punctuation.definition.instruction.begin.wast