blob: d4de3ff1e1e3e21065da3df669022747862e51f2 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: Hyper Builder
3" Maintainer: Alejandro Forero Cuervo
4" URL: http://bachue.com/hb/vim/syntax/hb.vim
Bram Moolenaar6ee8d892012-01-10 14:55:01 +01005" Last Change: 2012 Jan 08 by Thilo Six
Bram Moolenaar071d4272004-06-13 20:20:40 +00006
7" For version 5.x: Clear all syntax items
8" For version 6.x: Quit when a syntax file was already loaded
9if version < 600
10 syntax clear
11elseif exists("b:current_syntax")
12 finish
13endif
14
Bram Moolenaar6ee8d892012-01-10 14:55:01 +010015let s:cpo_save = &cpo
16set cpo&vim
17
Bram Moolenaar071d4272004-06-13 20:20:40 +000018" Read the HTML syntax to start with
19"syn include @HTMLStuff <sfile>:p:h/htmlhb.vim
20
21"this would be nice but we are supposed not to do it
22"set mps=<:>
23
24"syn region HBhtmlString contained start=+"+ end=+"+ contains=htmlSpecialChar
25"syn region HBhtmlString contained start=+'+ end=+'+ contains=htmlSpecialChar
26
27"syn match htmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"
28
29syn match htmlSpecialChar "&[^;]*;" contained
30
31syn match HBhtmlTagSk contained "[A-Za-z]*"
32
33syn match HBhtmlTagS contained "<\s*\(hb\s*\.\s*\(sec\|min\|hour\|day\|mon\|year\|input\|html\|time\|getcookie\|streql\|url-enc\)\|wall\s*\.\s*\(show\|info\|id\|new\|rm\|count\)\|auth\s*\.\s*\(chk\|add\|find\|user\)\|math\s*\.\s*exp\)\s*\([^.A-Za-z0-9]\|$\)" contains=HBhtmlTagSk transparent
34
35syn match HBhtmlTagN contained "[A-Za-z0-9\/\-]\+"
36
37syn match HBhtmlTagB contained "<\s*[A-Za-z0-9\/\-]\+\(\s*\.\s*[A-Za-z0-9\/\-]\+\)*" contains=HBhtmlTagS,HBhtmlTagN
38
39syn region HBhtmlTag contained start=+<+ end=+>+ contains=HBhtmlTagB,HBDirectiveError
40
41syn match HBFileName ".*" contained
42
43syn match HBDirectiveKeyword ":\s*\(include\|lib\|set\|out\)\s\+" contained
44
45syn match HBDirectiveError "^:.*$" contained
46
47"syn match HBDirectiveBlockEnd "^:\s*$" contained
48
49"syn match HBDirectiveOutHead "^:\s*out\s\+\S\+.*" contained contains=HBDirectiveKeyword,HBFileName
50
51"syn match HBDirectiveSetHead "^:\s*set\s\+\S\+.*" contained contains=HBDirectiveKeyword,HBFileName
52
53syn match HBInvalidLine "^.*$"
54
55syn match HBDirectiveInclude "^:\s*include\s\+\S\+.*$" contains=HBFileName,HBDirectiveKeyword
56
57syn match HBDirectiveLib "^:\s*lib\s\+\S\+.*$" contains=HBFileName,HBDirectiveKeyword
58
59syn region HBText matchgroup=HBDirectiveKeyword start=/^:\(set\|out\)\s*\S\+.*$/ end=/^:\s*$/ contains=HBDirectiveError,htmlSpecialChar,HBhtmlTag keepend
60
61"syn match HBLine "^:.*$" contains=HBDirectiveInclude,HBDirectiveLib,HBDirectiveError,HBDirectiveSet,HBDirectiveOut
62
63syn match HBComment "^#.*$"
64
65" Define the default highlighting.
66" For version 5.7 and earlier: only when not done already
67" For version 5.8 and later: only when an item doesn't have highlighting yet
68if version >= 508 || !exists("did_hb_syntax_inits")
69 if version < 508
70 let did_hb_syntax_inits = 1
71 command -nargs=+ HiLink hi link <args>
72 else
73 command -nargs=+ HiLink hi def link <args>
74 endif
75
76 HiLink HBhtmlString String
77 HiLink HBhtmlTagN Function
78 HiLink htmlSpecialChar String
79
80 HiLink HBInvalidLine Error
81 HiLink HBFoobar Comment
82 hi HBFileName guibg=lightgray guifg=black
83 HiLink HBDirectiveError Error
84 HiLink HBDirectiveBlockEnd HBDirectiveKeyword
85 hi HBDirectiveKeyword guibg=lightgray guifg=darkgreen
86 HiLink HBComment Comment
87 HiLink HBhtmlTagSk Statement
88
89 delcommand HiLink
90endif
91
92syn sync match Normal grouphere NONE "^:\s*$"
93syn sync match Normal grouphere NONE "^:\s*lib\s\+[^ \t]\+$"
94syn sync match Normal grouphere NONE "^:\s*include\s\+[^ \t]\+$"
95"syn sync match Block grouphere HBDirectiveSet "^#:\s*set\s\+[^ \t]\+"
96"syn sync match Block grouphere HBDirectiveOut "^#:\s*out\s\+[^ \t]\+"
97
98let b:current_syntax = "hb"
99
Bram Moolenaar6ee8d892012-01-10 14:55:01 +0100100let &cpo = s:cpo_save
101unlet s:cpo_save
Bram Moolenaar071d4272004-06-13 20:20:40 +0000102" vim: ts=8