Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: WEB Changes |
| 3 | " Maintainer: Andreas Scherer <andreas.scherer@pobox.com> |
| 4 | " Last Change: April 25, 2001 |
| 5 | |
| 6 | " Details of the change mechanism of the WEB and CWEB languages can be found |
| 7 | " in the articles by Donald E. Knuth and Silvio Levy cited in "web.vim" and |
| 8 | " "cweb.vim" respectively. |
| 9 | |
| 10 | " For version 5.x: Clear all syntax items |
| 11 | " For version 6.x: Quit when a syntax file was already loaded |
| 12 | if version < 600 |
| 13 | syn clear |
| 14 | elseif exists("b:current_syntax") |
| 15 | finish |
| 16 | endif |
| 17 | |
| 18 | " We distinguish two groups of material, (a) stuff between @x..@y, and |
| 19 | " (b) stuff between @y..@z. WEB/CWEB ignore everything else in a change file. |
| 20 | syn region changeFromMaterial start="^@x.*$"ms=e+1 end="^@y.*$"me=s-1 |
| 21 | syn region changeToMaterial start="^@y.*$"ms=e+1 end="^@z.*$"me=s-1 |
| 22 | |
| 23 | " Define the default highlighting. |
| 24 | " For version 5.7 and earlier: only when not done already |
| 25 | " For version 5.8 and later: only when an item doesn't have highlighting yet |
| 26 | if version >= 508 || !exists("did_change_syntax_inits") |
| 27 | if version < 508 |
| 28 | let did_change_syntax_inits = 1 |
| 29 | command -nargs=+ HiLink hi link <args> |
| 30 | else |
| 31 | command -nargs=+ HiLink hi def link <args> |
| 32 | endif |
| 33 | |
| 34 | HiLink changeFromMaterial String |
| 35 | HiLink changeToMaterial Statement |
| 36 | |
| 37 | delcommand HiLink |
| 38 | endif |
| 39 | |
| 40 | let b:current_syntax = "change" |
| 41 | |
| 42 | " vim: ts=8 |