190df5507SBram Moolenaar" Vim syntax file
2*fc39ecf8SBram Moolenaar" Language:	DataScript
390df5507SBram Moolenaar" Maintainer:	Dominique Pelle <[email protected]>
4*fc39ecf8SBram Moolenaar" Last Change:	2015 Jul 30
590df5507SBram Moolenaar"
690df5507SBram Moolenaar" DataScript is a formal language for modelling binary datatypes,
790df5507SBram Moolenaar" bitstreams or file formats. For more information, see:
8*fc39ecf8SBram Moolenaar"
9*fc39ecf8SBram Moolenaar" http://dstools.sourceforge.net/DataScriptLanguageOverview.html
1090df5507SBram Moolenaar
1190df5507SBram Moolenaarif version < 600
1290df5507SBram Moolenaar  syntax clear
1390df5507SBram Moolenaarelseif exists("b:current_syntax")
1490df5507SBram Moolenaar  finish
1590df5507SBram Moolenaarendif
169a7224b5SBram Moolenaarlet s:keepcpo= &cpo
179a7224b5SBram Moolenaarset cpo&vim
1890df5507SBram Moolenaar
1990df5507SBram Moolenaarsyn keyword dsPackage      import package
2076f3b1adSBram Moolenaarsyn keyword dsType         bit bool string
2176f3b1adSBram Moolenaarsyn keyword dsType         int int8 int16 int32 int64
2290df5507SBram Moolenaarsyn keyword dsType         uint8 uint16 uint32 uint64
23*fc39ecf8SBram Moolenaarsyn keyword dsType         varint16 varint32 varint64
24*fc39ecf8SBram Moolenaarsyn keyword dsType         varuint16 varuint32 varuint64
2590df5507SBram Moolenaarsyn keyword dsType         leint16 leint32 leint64
2690df5507SBram Moolenaarsyn keyword dsType         leuint16 leuint32 leuint64
2790df5507SBram Moolenaarsyn keyword dsEndian       little big
2890df5507SBram Moolenaarsyn keyword dsAlign        align
2990df5507SBram Moolenaarsyn keyword dsLabel        case default
3090df5507SBram Moolenaarsyn keyword dsConditional  if condition
3176f3b1adSBram Moolenaarsyn keyword dsBoolean      true false
3276f3b1adSBram Moolenaarsyn keyword dsCompound     union choice on enum bitmask subtype explicit
3390df5507SBram Moolenaarsyn keyword dsKeyword      function return
3490df5507SBram Moolenaarsyn keyword dsOperator     sizeof bitsizeof lengthof is sum forall in
3590df5507SBram Moolenaarsyn keyword dsStorageClass const
3690df5507SBram Moolenaarsyn keyword dsTodo         contained TODO FIXME XXX
3776f3b1adSBram Moolenaarsyn keyword dsSql          sql sql_table sql_database sql_pragma sql_index
38*fc39ecf8SBram Moolenaarsyn keyword dsSql          sql_integer sql_metadata sql_key sql_virtual
39*fc39ecf8SBram Moolenaarsyn keyword dsSql          using reference_key foreign_key to
4090df5507SBram Moolenaar
4190df5507SBram Moolenaar" dsCommentGroup allows adding matches for special things in comments.
4290df5507SBram Moolenaarsyn cluster dsCommentGroup  contains=dsTodo
4390df5507SBram Moolenaar
4490df5507SBram Moolenaarsyn match   dsOffset        display "^\s*[a-zA-Z_:\.][a-zA-Z0-9_:\.]*\s*:"
4590df5507SBram Moolenaar
4690df5507SBram Moolenaarsyn match   dsNumber        display "\<\d\+\>"
4790df5507SBram Moolenaarsyn match   dsNumberHex     display "\<0[xX]\x\+\>"
4890df5507SBram Moolenaarsyn match   dsNumberBin     display "\<[01]\+[bB]\>" contains=dsBinaryB
4990df5507SBram Moolenaarsyn match   dsBinaryB       display contained "[bB]\>"
5090df5507SBram Moolenaarsyn match   dsOctal         display "\<0\o\+\>" contains=dsOctalZero
5190df5507SBram Moolenaarsyn match   dsOctalZero     display contained "\<0"
5290df5507SBram Moolenaar
5390df5507SBram Moolenaarsyn match   dsOctalError    display "\<0\o*[89]\d*\>"
5490df5507SBram Moolenaar
5590df5507SBram Moolenaarsyn match   dsCommentError      display "\*/"
5690df5507SBram Moolenaarsyn match   dsCommentStartError display "/\*"me=e-1 contained
5790df5507SBram Moolenaar
5890df5507SBram Moolenaarsyn region   dsCommentL
5990df5507SBram Moolenaar  \ start="//" skip="\\$" end="$" keepend
6090df5507SBram Moolenaar  \ contains=@dsCommentGroup,@Spell
6190df5507SBram Moolenaarsyn region   dsComment
6290df5507SBram Moolenaar  \ matchgroup=dsCommentStart start="/\*" end="\*/"
6390df5507SBram Moolenaar  \ contains=@dsCommentGroup,dsCommentStartError,@Spell extend
6490df5507SBram Moolenaar
6590df5507SBram Moolenaarsyn region  dsString
6690df5507SBram Moolenaar  \ start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell
6790df5507SBram Moolenaar
68*fc39ecf8SBram Moolenaarsyn sync ccomment dsComment
69*fc39ecf8SBram Moolenaar
7090df5507SBram Moolenaar" Define the default highlighting.
7190df5507SBram Moolenaarhi def link dsType              Type
7290df5507SBram Moolenaarhi def link dsEndian            StorageClass
7390df5507SBram Moolenaarhi def link dsStorageClass      StorageClass
7490df5507SBram Moolenaarhi def link dsAlign             Label
7590df5507SBram Moolenaarhi def link dsLabel             Label
7690df5507SBram Moolenaarhi def link dsOffset            Label
7790df5507SBram Moolenaarhi def link dsSql               PreProc
7890df5507SBram Moolenaarhi def link dsCompound          Structure
7990df5507SBram Moolenaarhi def link dsConditional       Conditional
8076f3b1adSBram Moolenaarhi def link dsBoolean           Boolean
8190df5507SBram Moolenaarhi def link dsKeyword           Statement
8290df5507SBram Moolenaarhi def link dsString            String
8390df5507SBram Moolenaarhi def link dsNumber            Number
8490df5507SBram Moolenaarhi def link dsNumberBin         Number
8590df5507SBram Moolenaarhi def link dsBinaryB           Special
8690df5507SBram Moolenaarhi def link dsOctal             Number
8790df5507SBram Moolenaarhi def link dsOctalZero         Special
8890df5507SBram Moolenaarhi def link dsOctalError        Error
8990df5507SBram Moolenaarhi def link dsNumberHex         Number
9090df5507SBram Moolenaarhi def link dsTodo              Todo
9190df5507SBram Moolenaarhi def link dsOperator          Operator
9290df5507SBram Moolenaarhi def link dsPackage           Include
9390df5507SBram Moolenaarhi def link dsCommentError      Error
9490df5507SBram Moolenaarhi def link dsCommentStartError Error
9590df5507SBram Moolenaarhi def link dsCommentStart      dsComment
9690df5507SBram Moolenaarhi def link dsCommentL          dsComment
9790df5507SBram Moolenaarhi def link cCommentL           dsComment
9890df5507SBram Moolenaarhi def link dsComment           Comment
9990df5507SBram Moolenaar
10090df5507SBram Moolenaarlet b:current_syntax = "datascript"
1019a7224b5SBram Moolenaar
1029a7224b5SBram Moolenaarlet &cpo = s:keepcpo
1039a7224b5SBram Moolenaarunlet s:keepcpo
104