2 " Language: Relax NG compact syntax
3 " Maintainer: Nikolai Weibull <now@bitwi.se>
4 " Latest Revision: 2007-06-17
6 if exists("b:current_syntax")
13 setlocal iskeyword+=-,.
15 syn keyword rncTodo contained TODO FIXME XXX NOTE
17 syn region rncComment display oneline start='^\s*#' end='$'
18 \ contains=rncTodo,@Spell
20 syn match rncOperator display '[-|,&+?*~]'
21 syn match rncOperator display '\%(|&\)\=='
22 syn match rncOperator display '>>'
24 syn match rncNamespace display '\<\k\+:'
26 syn match rncQuoted display '\\\k\+\>'
28 syn match rncSpecial display '\\x{\x\+}'
30 syn region rncAnnotation transparent start='\[' end='\]'
31 \ contains=ALLBUT,rncComment,rncTodo
33 syn region rncLiteral display oneline start=+"+ end=+"+
35 syn region rncLiteral display oneline start=+'+ end=+'+
36 syn region rncLiteral display oneline start=+"""+ end=+"""+
38 syn region rncLiteral display oneline start=+'''+ end=+'''+
40 syn match rncDelimiter display '[{},()]'
42 syn keyword rncKeyword datatypes default div empty external grammar
43 syn keyword rncKeyword include inherit list mixed name namespace
44 syn keyword rncKeyword notAllowed parent start string text token
46 syn match rncIdentifier display '\k\+\_s*\%(=\|&=\||=\)\@='
47 \ nextgroup=rncOperator
48 syn keyword rncKeyword element attribute
49 \ nextgroup=rncIdName skipwhite skipempty
50 syn match rncIdName contained '\k\+'
52 hi def link rncTodo Todo
53 hi def link rncComment Comment
54 hi def link rncOperator Operator
55 hi def link rncNamespace Identifier
56 hi def link rncQuoted Special
57 hi def link rncSpecial SpecialChar
58 hi def link rncAnnotation Special
59 hi def link rncLiteral String
60 hi def link rncDelimiter Delimiter
61 hi def link rncKeyword Keyword
62 hi def link rncIdentifier Identifier
63 hi def link rncIdName Identifier
65 let b:current_syntax = "rnc"