# HG changeset patch # User Christian Brabandt # Date 1691593203 -7200 # Node ID 2023f0835f75f3554e9337b8e8bf31e75ea2ba98 # Parent 3c1bab29c2f445027814ee9d61a7d25a1d524232 update .wast files syntax highlighting (#12741) Commit: https://github.com/vim/vim/commit/8f566fdb1e3452c9104d9e7af402adbfbcb463c7 Author: Linda_pp Date: Wed Aug 9 23:45:52 2023 +0900 update .wast files syntax highlighting (https://github.com/vim/vim/issues/12741) diff --git a/runtime/syntax/wast.vim b/runtime/syntax/wast.vim --- a/runtime/syntax/wast.vim +++ b/runtime/syntax/wast.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: WebAssembly " Maintainer: rhysd -" Last Change: Jul 29, 2018 +" Last Change: Aug 7, 2023 " For bugs, patches and license go to https://github.com/rhysd/vim-wasm if exists("b:current_syntax") @@ -11,33 +11,42 @@ endif let s:cpo_save = &cpo set cpo&vim -syn cluster wastCluster contains=wastModule,wastInstWithType,wastInstGeneral,wastParamInst,wastControlInst,wastString,wastNamedVar,wastUnnamedVar,wastFloat,wastNumber,wastComment,wastList,wastType +syn cluster wastNotTop contains=wastModule,wastInstWithType,wastInstGetSet,wastInstGeneral,wastParamInst,wastControlInst,wastSimdInst,wastString,wastNamedVar,wastUnnamedVar,wastFloat,wastNumber,wastComment,wastList,wastType " Instructions " https://webassembly.github.io/spec/core/text/instructions.html " Note: memarg (align=,offset=) can be added to memory instructions syn match wastInstWithType "\%((\s*\)\@<=\<\%(i32\|i64\|f32\|f64\|memory\)\.[[:alnum:]_]\+\%(/\%(i32\|i64\|f32\|f64\)\)\=\>\%(\s\+\%(align\|offset\)=\)\=" contained display syn match wastInstGeneral "\%((\s*\)\@<=\<[[:alnum:]_]\+\>" contained display +syn match wastInstGetSet "\%((\s*\)\@<=\<\%(local\|global\)\.\%(get\|set\)\>" contained display " https://webassembly.github.io/spec/core/text/instructions.html#control-instructions -syn match wastControlInst "\%((\s*\)\@<=\<\%(block\|end\|loop\|if\|else\|unreachable\|nop\|br\|br_if\|br_table\|return\|call\|call_indirect\)\>" contained display +syn match wastControlInst "\%((\s*\)\@<=\<\%(block\|end\|loop\|if\|then\|else\|unreachable\|nop\|br\|br_if\|br_table\|return\|call\|call_indirect\)\>" contained display " https://webassembly.github.io/spec/core/text/instructions.html#parametric-instructions syn match wastParamInst "\%((\s*\)\@<=\<\%(drop\|select\)\>" contained display +" SIMD instructions +" https://webassembly.github.io/simd/core/text/instructions.html#simd-instructions +syn match wastSimdInst "\<\%(v128\|i8x16\|i16x8\|i32x4\|i64x2\|f32x4\|f64x2)\)\.[[:alnum:]_]\+\%(\s\+\%(i8x16\|i16x8\|i32x4\|i64x2\|f32x4\|f64x2\)\)\=\>" contained display " Identifiers " https://webassembly.github.io/spec/core/text/values.html#text-id -syn match wastNamedVar "$\+[[:alnum:]!#$%&'∗./:=>