Mercurial > hg > RemoteEditor > vim7
comparison runtime/syntax/latte.vim @ 0:76efa0be13f1
Initial revision
author | atsuki |
---|---|
date | Sat, 10 Nov 2007 15:07:22 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:76efa0be13f1 |
---|---|
1 " Vim syntax file | |
2 " Language: Latte | |
3 " Maintainer: Nick Moffitt, <nick@zork.net> | |
4 " Last Change: 14 June, 2000 | |
5 " | |
6 " Notes: | |
7 " I based this on the TeX and Scheme syntax files (but mostly scheme). | |
8 " See http://www.latte.org for info on the language. | |
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 syntax clear | |
14 elseif exists("b:current_syntax") | |
15 finish | |
16 endif | |
17 | |
18 syn match latteError "[{}\\]" | |
19 syn match latteOther "\\{" | |
20 syn match latteOther "\\}" | |
21 syn match latteOther "\\\\" | |
22 | |
23 if version < 600 | |
24 set iskeyword=33,43,45,48-57,63,65-90,95,97-122,_ | |
25 else | |
26 setlocal iskeyword=33,43,45,48-57,63,65-90,95,97-122,_ | |
27 endif | |
28 | |
29 syn region latteVar matchgroup=SpecialChar start=!\\[A-Za-z_]!rs=s+1 end=![^A-Za-z0-9?!+_-]!me=e-1 contains=ALLBUT,latteNumber,latteOther | |
30 syn region latteVar matchgroup=SpecialChar start=!\\[=\&][A-Za-z_]!rs=s+2 end=![^A-Za-z0-9?!+_-]!me=e-1 contains=ALLBUT,latteNumber,latteOther | |
31 syn region latteString start=+\\"+ skip=+\\\\"+ end=+\\"+ | |
32 | |
33 syn region latteGroup matchgroup=Delimiter start="{" skip="\\[{}]" matchgroup=Delimiter end="}" contains=ALLBUT,latteSyntax | |
34 | |
35 syn region latteUnquote matchgroup=Delimiter start="\\,{" skip="\\[{}]" matchgroup=Delimiter end="}" contains=ALLBUT,latteSyntax | |
36 syn region latteSplice matchgroup=Delimiter start="\\,@{" skip="\\[{}]" matchgroup=Delimiter end="}" contains=ALLBUT,latteSyntax | |
37 syn region latteQuote matchgroup=Delimiter start="\\'{" skip="\\[{}]" matchgroup=Delimiter end="}" | |
38 syn region latteQuote matchgroup=Delimiter start="\\`{" skip="\\[{}]" matchgroup=Delimiter end="}" contains=latteUnquote,latteSplice | |
39 | |
40 syn match latteOperator '\\/' | |
41 syn match latteOperator '=' | |
42 | |
43 syn match latteComment "\\;.*$" | |
44 | |
45 " This was gathered by slurping in the index. | |
46 | |
47 syn keyword latteSyntax __FILE__ __latte-version__ contained | |
48 syn keyword latteSyntax _bal-tag _pre _tag add and append apply back contained | |
49 syn keyword latteSyntax caar cadr car cdar cddr cdr ceil compose contained | |
50 syn keyword latteSyntax concat cons def defmacro divide downcase contained | |
51 syn keyword latteSyntax empty? equal? error explode file-contents contained | |
52 syn keyword latteSyntax floor foreach front funcall ge? getenv contained | |
53 syn keyword latteSyntax greater-equal? greater? group group? gt? html contained | |
54 syn keyword latteSyntax if include lambda le? length less-equal? contained | |
55 syn keyword latteSyntax less? let lmap load-file load-library lt? macro contained | |
56 syn keyword latteSyntax member? modulo multiply not nth operator? contained | |
57 syn keyword latteSyntax or ordinary quote process-output push-back contained | |
58 syn keyword latteSyntax push-front quasiquote quote random rdc reverse contained | |
59 syn keyword latteSyntax set! snoc splicing unquote strict-html4 contained | |
60 syn keyword latteSyntax string-append string-ge? string-greater-equal? contained | |
61 syn keyword latteSyntax string-greater? string-gt? string-le? contained | |
62 syn keyword latteSyntax string-less-equal? string-less? string-lt? contained | |
63 syn keyword latteSyntax string? subseq substr subtract contained | |
64 syn keyword latteSyntax upcase useless warn while zero? contained | |
65 | |
66 | |
67 " If it's good enough for scheme... | |
68 | |
69 syn sync match matchPlace grouphere NONE "^[^ \t]" | |
70 " ... i.e. synchronize on a line that starts at the left margin | |
71 | |
72 " Define the default highlighting. | |
73 " For version 5.7 and earlier: only when not done already | |
74 " For version 5.8 and later: only when an item doesn't have highlighting yet | |
75 if version >= 508 || !exists("did_latte_syntax_inits") | |
76 if version < 508 | |
77 let did_latte_syntax_inits = 1 | |
78 command -nargs=+ HiLink hi link <args> | |
79 else | |
80 command -nargs=+ HiLink hi def link <args> | |
81 endif | |
82 | |
83 HiLink latteSyntax Statement | |
84 HiLink latteVar Function | |
85 | |
86 HiLink latteString String | |
87 HiLink latteQuote String | |
88 | |
89 HiLink latteDelimiter Delimiter | |
90 HiLink latteOperator Operator | |
91 | |
92 HiLink latteComment Comment | |
93 HiLink latteError Error | |
94 | |
95 delcommand HiLink | |
96 endif | |
97 | |
98 let b:current_syntax = "latte" |