blob: 7bff1df9fb5591a5f41db8f33907eeabacd0739c [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
Bram Moolenaar89bcfda2016-08-30 23:26:57 +02007" quit when a syntax file was already loaded
8if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +00009 finish
10endif
11
Bram Moolenaar6ee8d892012-01-10 14:55:01 +010012let s:cpo_save = &cpo
13set cpo&vim
14
Bram Moolenaar071d4272004-06-13 20:20:40 +000015" Read the HTML syntax to start with
16"syn include @HTMLStuff <sfile>:p:h/htmlhb.vim
17
18"this would be nice but we are supposed not to do it
19"set mps=<:>
20
21"syn region HBhtmlString contained start=+"+ end=+"+ contains=htmlSpecialChar
22"syn region HBhtmlString contained start=+'+ end=+'+ contains=htmlSpecialChar
23
24"syn match htmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"
25
26syn match htmlSpecialChar "&[^;]*;" contained
27
28syn match HBhtmlTagSk contained "[A-Za-z]*"
29
30syn 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
31
32syn match HBhtmlTagN contained "[A-Za-z0-9\/\-]\+"
33
34syn match HBhtmlTagB contained "<\s*[A-Za-z0-9\/\-]\+\(\s*\.\s*[A-Za-z0-9\/\-]\+\)*" contains=HBhtmlTagS,HBhtmlTagN
35
36syn region HBhtmlTag contained start=+<+ end=+>+ contains=HBhtmlTagB,HBDirectiveError
37
38syn match HBFileName ".*" contained
39
40syn match HBDirectiveKeyword ":\s*\(include\|lib\|set\|out\)\s\+" contained
41
42syn match HBDirectiveError "^:.*$" contained
43
44"syn match HBDirectiveBlockEnd "^:\s*$" contained
45
46"syn match HBDirectiveOutHead "^:\s*out\s\+\S\+.*" contained contains=HBDirectiveKeyword,HBFileName
47
48"syn match HBDirectiveSetHead "^:\s*set\s\+\S\+.*" contained contains=HBDirectiveKeyword,HBFileName
49
50syn match HBInvalidLine "^.*$"
51
52syn match HBDirectiveInclude "^:\s*include\s\+\S\+.*$" contains=HBFileName,HBDirectiveKeyword
53
54syn match HBDirectiveLib "^:\s*lib\s\+\S\+.*$" contains=HBFileName,HBDirectiveKeyword
55
56syn region HBText matchgroup=HBDirectiveKeyword start=/^:\(set\|out\)\s*\S\+.*$/ end=/^:\s*$/ contains=HBDirectiveError,htmlSpecialChar,HBhtmlTag keepend
57
58"syn match HBLine "^:.*$" contains=HBDirectiveInclude,HBDirectiveLib,HBDirectiveError,HBDirectiveSet,HBDirectiveOut
59
60syn match HBComment "^#.*$"
61
62" Define the default highlighting.
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020063" Only when an item doesn't have highlighting yet
Bram Moolenaar071d4272004-06-13 20:20:40 +000064
Bram Moolenaarf37506f2016-08-31 22:22:10 +020065hi def link HBhtmlString String
66hi def link HBhtmlTagN Function
67hi def link htmlSpecialChar String
Bram Moolenaar071d4272004-06-13 20:20:40 +000068
Bram Moolenaarf37506f2016-08-31 22:22:10 +020069hi def link HBInvalidLine Error
70hi def link HBFoobar Comment
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020071hi HBFileName guibg=lightgray guifg=black
Bram Moolenaarf37506f2016-08-31 22:22:10 +020072hi def link HBDirectiveError Error
73hi def link HBDirectiveBlockEnd HBDirectiveKeyword
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020074hi HBDirectiveKeyword guibg=lightgray guifg=darkgreen
Bram Moolenaarf37506f2016-08-31 22:22:10 +020075hi def link HBComment Comment
76hi def link HBhtmlTagSk Statement
Bram Moolenaar071d4272004-06-13 20:20:40 +000077
Bram Moolenaar071d4272004-06-13 20:20:40 +000078
79syn sync match Normal grouphere NONE "^:\s*$"
80syn sync match Normal grouphere NONE "^:\s*lib\s\+[^ \t]\+$"
81syn sync match Normal grouphere NONE "^:\s*include\s\+[^ \t]\+$"
82"syn sync match Block grouphere HBDirectiveSet "^#:\s*set\s\+[^ \t]\+"
83"syn sync match Block grouphere HBDirectiveOut "^#:\s*out\s\+[^ \t]\+"
84
85let b:current_syntax = "hb"
86
Bram Moolenaar6ee8d892012-01-10 14:55:01 +010087let &cpo = s:cpo_save
88unlet s:cpo_save
Bram Moolenaar071d4272004-06-13 20:20:40 +000089" vim: ts=8