3 " Maintainer: Nick Moffitt, <nick@zork.net>
4 " Last Change: 14 June, 2000
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.
10 " For version 5.x: Clear all syntax items
11 " For version 6.x: Quit when a syntax file was already loaded
14 elseif exists("b:current_syntax")
18 syn match latteError "[{}\\]"
19 syn match latteOther "\\{"
20 syn match latteOther "\\}"
21 syn match latteOther "\\\\"
24 set iskeyword=33,43,45,48-57,63,65-90,95,97-122,_
26 setlocal iskeyword=33,43,45,48-57,63,65-90,95,97-122,_
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=+\\"+
33 syn region latteGroup matchgroup=Delimiter start="{" skip="\\[{}]" matchgroup=Delimiter end="}" contains=ALLBUT,latteSyntax
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
40 syn match latteOperator '\\/'
41 syn match latteOperator '='
43 syn match latteComment "\\;.*$"
45 " This was gathered by slurping in the index.
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
67 " If it's good enough for scheme...
69 syn sync match matchPlace grouphere NONE "^[^ \t]"
70 " ... i.e. synchronize on a line that starts at the left margin
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")
77 let did_latte_syntax_inits = 1
78 command -nargs=+ HiLink hi link <args>
80 command -nargs=+ HiLink hi def link <args>
83 HiLink latteSyntax Statement
84 HiLink latteVar Function
86 HiLink latteString String
87 HiLink latteQuote String
89 HiLink latteDelimiter Delimiter
90 HiLink latteOperator Operator
92 HiLink latteComment Comment
93 HiLink latteError Error
98 let b:current_syntax = "latte"