if exists current_syntax finish endif if exists main_syntax let main_s

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
if exists("b:current_syntax")
finish
endif
if !exists("main_syntax")
let main_syntax = 'jade'
endif
syn case match
syn match Comment "//-.*"
syn match CommentBlock "^\(\s*\)//-.*\n\(\(\1\s.*\n\)\|\n\)*"
syn match textBlock '\(\.\n\+\)\(\s\+\).*'
"syn match textBlock 'qtest[\n]\s\+this'
syn match tagWithType '^\s*\([a-zA-Z][a-zA-Z\-0-9]*\)\([#.][a-zA-Z][a-zA-Z\-0-9]*\)*' contains=tagName,tagId,tagClass nextgroup=tagArgsRegion,tagTextInline,textBlock
syn match tagText '^\s*|.*' contains=angularTag
"\(\s+\).*\n\(\1\(.*\|[\n]\)*\)*\n' contains=angularTag
syn match jadeLang '\s*-.*'
"\(.*|\n\)*'"\(\s\+\).*[\n]'
"\(\1.*\n\)*'
syn match tagTextInline '.*' contained contains=angularTag
syn match tagClass '\.[a-zA-Z][a-zA-Z0-9\-_]\+' contained
syn match tagId '#[a-zA-Z][a-zA-Z0-9\-_]\+' contained
syn match tagName '^\s*\([a-zA-Z][a-zA-Z\-0-9]*\)' nextgroup=tagId,tagClass,tagArgs,tagText contained nextgroup=tagClass,tagId,tagArgsRegion
syn region tagArgsRegion start="(" end=")" contains=attributeWithStringValue,attributeWithNumericValue,attributeName nextgroup=textBlock,tagWithType,tagTextInline,tagClass,tagId
syn match attributeName "\([a-zA-Z][a-zA-Z\-0-9]\+\)" containedin=attributeWithStringValue,attributeWithNumericValue nextgroup=equalsSign
syn region stringValueDouble start='"' skip='\\"' end='"' containedin=attributeWithStringValue contains=angularTag,variable
syn region stringValueSingle start="'" skip="\\'" end="'" containedin=attributeWithStringValue contains=angularTag,variable
syn match stringValueNumeric '\d\+' containedin=attributeWithNumericValue
syn region angularTag start="{{" skip="\\}}" end="}}" contained
syn region variable start="#{" end="}" contained
syn match equalsSign '=' contained nextgroup=stringValueDouble,stringValueSingle,stringValueNumeric
syn match attributeWithStringValue "[a-zA-Z][a-zA-Z0-9\-_]\+\s*=\s*\(['\"]\)[^\1]*\1" contains=attributeName,equalsSign,stringValueSingle,stringValueDouble contained
syn match attributeWithNumericValue "[a-zA-Z][a-zA-Z0-9\-_]\+\s*=\s*\d\+" contains=attributeName,equalsSign,stringValueNumeric contained
hi def link tagName Identifier
hi def link attributeName Statement
hi def link stringValueDouble String
hi def link stringValueSingle String
hi def link stringValueNumeric Constant
hi def link tagClass Type
hi def link tagId PreProc
hi def link CommentBlock Comment
hi def link angularTag Special
hi def link variable Special
hi def link jadeLang PreProc
let b:current_syntax = "jade"
if main_syntax == "jade"
unlet main_syntax
endif