Install vim74
[msysgit.git] / share / vim / vim74 / syntax / datascript.vim
blob76f977ac1372c765d3267826c6417308dc8e3662
1 " Vim syntax file
2 " Language:     Datascript
3 " Maintainer:   Dominique Pelle <dominique.pelle@gmail.com>
4 " Last Change:  2012 Apr 30
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
15 let s:keepcpo= &cpo
16 set cpo&vim
18 syn keyword dsPackage      import package
19 syn keyword dsType         bit string
20 syn keyword dsType         int8 int16 int32 int64
21 syn keyword dsType         uint8 uint16 uint32 uint64
22 syn keyword dsType         leint16 leint32 leint64
23 syn keyword dsType         leuint16 leuint32 leuint64
24 syn keyword dsEndian       little big
25 syn keyword dsAlign        align
26 syn keyword dsLabel        case default
27 syn keyword dsConditional  if condition
28 syn keyword dsCompound     union choice on enum bitmask subtype
29 syn keyword dsKeyword      function return
30 syn keyword dsOperator     sizeof bitsizeof lengthof is sum forall in
31 syn keyword dsStorageClass const
32 syn keyword dsTodo         contained TODO FIXME XXX
33 syn keyword dsSql          sql sql_table sql_database sql_pragma
34 syn keyword dsSql          sql_integer sql_metadata sql_key
36 " dsCommentGroup allows adding matches for special things in comments.
37 syn cluster dsCommentGroup  contains=dsTodo
39 syn match   dsOffset        display "^\s*[a-zA-Z_:\.][a-zA-Z0-9_:\.]*\s*:"
41 syn match   dsNumber        display "\<\d\+\>"
42 syn match   dsNumberHex     display "\<0[xX]\x\+\>"
43 syn match   dsNumberBin     display "\<[01]\+[bB]\>" contains=dsBinaryB
44 syn match   dsBinaryB       display contained "[bB]\>"
45 syn match   dsOctal         display "\<0\o\+\>" contains=dsOctalZero
46 syn match   dsOctalZero     display contained "\<0"
48 syn match   dsOctalError    display "\<0\o*[89]\d*\>"
50 syn match   dsCommentError      display "\*/"
51 syn match   dsCommentStartError display "/\*"me=e-1 contained
53 syn region   dsCommentL
54   \ start="//" skip="\\$" end="$" keepend
55   \ contains=@dsCommentGroup,@Spell
56 syn region   dsComment
57   \ matchgroup=dsCommentStart start="/\*" end="\*/"
58   \ contains=@dsCommentGroup,dsCommentStartError,@Spell extend
60 syn region  dsString
61   \ start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell
63 " Define the default highlighting.
64 hi def link dsType              Type
65 hi def link dsEndian            StorageClass
66 hi def link dsStorageClass      StorageClass
67 hi def link dsAlign             Label
68 hi def link dsLabel             Label
69 hi def link dsOffset            Label
70 hi def link dsSql               PreProc
71 hi def link dsCompound          Structure
72 hi def link dsConditional       Conditional
73 hi def link dsKeyword           Statement
74 hi def link dsString            String
75 hi def link dsNumber            Number
76 hi def link dsNumberBin         Number
77 hi def link dsBinaryB           Special
78 hi def link dsOctal             Number
79 hi def link dsOctalZero         Special
80 hi def link dsOctalError        Error
81 hi def link dsNumberHex         Number
82 hi def link dsTodo              Todo
83 hi def link dsOperator          Operator
84 hi def link dsPackage           Include
85 hi def link dsCommentError      Error
86 hi def link dsCommentStartError Error
87 hi def link dsCommentStart      dsComment
88 hi def link dsCommentL          dsComment
89 hi def link cCommentL           dsComment
90 hi def link dsComment           Comment
92 let b:current_syntax = "datascript"
94 let &cpo = s:keepcpo
95 unlet s:keepcpo