Install vim73
[msysgit/mtrensch.git] / share / vim / vim73 / syntax / datascript.vim
blobb51f41877fa0cc5228226e0844e47421ebcbfdec
1 " Vim syntax file
2 " Language:     Datascript
3 " Maintainer:   Dominique Pelle <dominique.pelle@gmail.com>
4 " Last Change:  2010-08-01
6 " DataScript is a formal language for modelling binary datatypes,
7 " bitstreams or file formats. For more information, see:
8 " http://datascript.berlios.de/DataScriptLanguageOverview.html
10 if version < 600
11   syntax clear
12 elseif exists("b:current_syntax")
13   finish
14 endif
16 syn keyword dsPackage      import package
17 syn keyword dsType         bit string
18 syn keyword dsType         int8 int16 int32 int64
19 syn keyword dsType         uint8 uint16 uint32 uint64
20 syn keyword dsType         leint16 leint32 leint64
21 syn keyword dsType         leuint16 leuint32 leuint64
22 syn keyword dsEndian       little big
23 syn keyword dsAlign        align
24 syn keyword dsLabel        case default
25 syn keyword dsConditional  if condition
26 syn keyword dsCompound     union choice on enum bitmask subtype
27 syn keyword dsKeyword      function return
28 syn keyword dsOperator     sizeof bitsizeof lengthof is sum forall in
29 syn keyword dsStorageClass const
30 syn keyword dsTodo         contained TODO FIXME XXX
31 syn keyword dsSql          sql sql_table sql_database sql_pragma
32 syn keyword dsSql          sql_integer sql_metadata sql_key
34 " dsCommentGroup allows adding matches for special things in comments.
35 syn cluster dsCommentGroup  contains=dsTodo
37 syn match   dsOffset        display "^\s*[a-zA-Z_:\.][a-zA-Z0-9_:\.]*\s*:"
39 syn match   dsNumber        display "\<\d\+\>"
40 syn match   dsNumberHex     display "\<0[xX]\x\+\>"
41 syn match   dsNumberBin     display "\<[01]\+[bB]\>" contains=dsBinaryB
42 syn match   dsBinaryB       display contained "[bB]\>"
43 syn match   dsOctal         display "\<0\o\+\>" contains=dsOctalZero
44 syn match   dsOctalZero     display contained "\<0"
46 syn match   dsOctalError    display "\<0\o*[89]\d*\>"
48 syn match   dsCommentError      display "\*/"
49 syn match   dsCommentStartError display "/\*"me=e-1 contained
51 syn region   dsCommentL
52   \ start="//" skip="\\$" end="$" keepend
53   \ contains=@dsCommentGroup,@Spell
54 syn region   dsComment
55   \ matchgroup=dsCommentStart start="/\*" end="\*/"
56   \ contains=@dsCommentGroup,dsCommentStartError,@Spell extend
58 syn region  dsString
59   \ start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell
61 " Define the default highlighting.
62 hi def link dsType              Type
63 hi def link dsEndian            StorageClass
64 hi def link dsStorageClass      StorageClass
65 hi def link dsAlign             Label
66 hi def link dsLabel             Label
67 hi def link dsOffset            Label
68 hi def link dsSql               PreProc
69 hi def link dsCompound          Structure
70 hi def link dsConditional       Conditional
71 hi def link dsKeyword           Statement
72 hi def link dsString            String
73 hi def link dsNumber            Number
74 hi def link dsNumberBin         Number
75 hi def link dsBinaryB           Special
76 hi def link dsOctal             Number
77 hi def link dsOctalZero         Special
78 hi def link dsOctalError        Error
79 hi def link dsNumberHex         Number
80 hi def link dsTodo              Todo
81 hi def link dsOperator          Operator
82 hi def link dsPackage           Include
83 hi def link dsCommentError      Error
84 hi def link dsCommentStartError Error
85 hi def link dsCommentStart      dsComment
86 hi def link dsCommentL          dsComment
87 hi def link cCommentL           dsComment
88 hi def link dsComment           Comment
90 let b:current_syntax = "datascript"