blob: 4b664a177e5b95e97e9dd0ad8322434edafecee3 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: Windows Scripting Host
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00003" Maintainer: Paul Moore <pf_moore AT yahoo.co.uk>
Bram Moolenaar071d4272004-06-13 20:20:40 +00004" Last Change: Fre, 24 Nov 2000 21:54:09 +0100
5
6" This reuses the XML, VB and JavaScript syntax files. While VB is not
7" VBScript, it's close enough for us. No attempt is made to handle
8" other languages.
9" Send comments, suggestions and requests to the maintainer.
10
11" Quit when a syntax file was already loaded
12if exists("b:current_syntax")
13 finish
14endif
15
16let s:wsh_cpo_save = &cpo
17set cpo&vim
18
19runtime! syntax/xml.vim
20unlet b:current_syntax
21
22syn case ignore
23syn include @wshVBScript <sfile>:p:h/vb.vim
24unlet b:current_syntax
25syn include @wshJavaScript <sfile>:p:h/javascript.vim
26unlet b:current_syntax
27syn region wshVBScript
28 \ matchgroup=xmlTag start="<script[^>]*VBScript\(>\|[^>]*[^/>]>\)"
29 \ matchgroup=xmlEndTag end="</script>"
30 \ fold
31 \ contains=@wshVBScript
32 \ keepend
33syn region wshJavaScript
34 \ matchgroup=xmlTag start="<script[^>]*J\(ava\)\=Script\(>\|[^>]*[^/>]>\)"
35 \ matchgroup=xmlEndTag end="</script>"
36 \ fold
37 \ contains=@wshJavaScript
38 \ keepend
39
40syn cluster xmlRegionHook add=wshVBScript,wshJavaScript
41
42let b:current_syntax = "wsh"
43
44let &cpo = s:wsh_cpo_save
45unlet s:wsh_cpo_save