Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: Windows Scripting Host |
Bram Moolenaar | 89cb5e0 | 2004-07-19 20:55:54 +0000 | [diff] [blame] | 3 | " Maintainer: Paul Moore <pf_moore AT yahoo.co.uk> |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4 | " 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 |
| 12 | if exists("b:current_syntax") |
| 13 | finish |
| 14 | endif |
| 15 | |
| 16 | let s:wsh_cpo_save = &cpo |
| 17 | set cpo&vim |
| 18 | |
| 19 | runtime! syntax/xml.vim |
| 20 | unlet b:current_syntax |
| 21 | |
| 22 | syn case ignore |
| 23 | syn include @wshVBScript <sfile>:p:h/vb.vim |
| 24 | unlet b:current_syntax |
| 25 | syn include @wshJavaScript <sfile>:p:h/javascript.vim |
| 26 | unlet b:current_syntax |
| 27 | syn region wshVBScript |
| 28 | \ matchgroup=xmlTag start="<script[^>]*VBScript\(>\|[^>]*[^/>]>\)" |
| 29 | \ matchgroup=xmlEndTag end="</script>" |
| 30 | \ fold |
| 31 | \ contains=@wshVBScript |
| 32 | \ keepend |
| 33 | syn region wshJavaScript |
| 34 | \ matchgroup=xmlTag start="<script[^>]*J\(ava\)\=Script\(>\|[^>]*[^/>]>\)" |
| 35 | \ matchgroup=xmlEndTag end="</script>" |
| 36 | \ fold |
| 37 | \ contains=@wshJavaScript |
| 38 | \ keepend |
| 39 | |
| 40 | syn cluster xmlRegionHook add=wshVBScript,wshJavaScript |
| 41 | |
| 42 | let b:current_syntax = "wsh" |
| 43 | |
| 44 | let &cpo = s:wsh_cpo_save |
| 45 | unlet s:wsh_cpo_save |