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