190df5507SBram Moolenaar" Vim syntax file
290df5507SBram Moolenaar" Language:	Datascript
390df5507SBram Moolenaar" Maintainer:	Dominique Pelle <[email protected]>
4*76f3b1adSBram Moolenaar" Last Change:	2014 Feb 26
590df5507SBram Moolenaar"
690df5507SBram Moolenaar" DataScript is a formal language for modelling binary datatypes,
790df5507SBram Moolenaar" bitstreams or file formats. For more information, see:
890df5507SBram Moolenaar" http://datascript.berlios.de/DataScriptLanguageOverview.html
990df5507SBram Moolenaar
1090df5507SBram Moolenaarif version < 600
1190df5507SBram Moolenaar  syntax clear
1290df5507SBram Moolenaarelseif exists("b:current_syntax")
1390df5507SBram Moolenaar  finish
1490df5507SBram Moolenaarendif
159a7224b5SBram Moolenaarlet s:keepcpo= &cpo
169a7224b5SBram Moolenaarset cpo&vim
1790df5507SBram Moolenaar
1890df5507SBram Moolenaarsyn keyword dsPackage      import package
19*76f3b1adSBram Moolenaarsyn keyword dsType         bit bool string
20*76f3b1adSBram Moolenaarsyn keyword dsType         int int8 int16 int32 int64
2190df5507SBram Moolenaarsyn keyword dsType         uint8 uint16 uint32 uint64
2290df5507SBram Moolenaarsyn keyword dsType         leint16 leint32 leint64
2390df5507SBram Moolenaarsyn keyword dsType         leuint16 leuint32 leuint64
2490df5507SBram Moolenaarsyn keyword dsEndian       little big
2590df5507SBram Moolenaarsyn keyword dsAlign        align
2690df5507SBram Moolenaarsyn keyword dsLabel        case default
2790df5507SBram Moolenaarsyn keyword dsConditional  if condition
28*76f3b1adSBram Moolenaarsyn keyword dsBoolean      true false
29*76f3b1adSBram Moolenaarsyn keyword dsCompound     union choice on enum bitmask subtype explicit
3090df5507SBram Moolenaarsyn keyword dsKeyword      function return
3190df5507SBram Moolenaarsyn keyword dsOperator     sizeof bitsizeof lengthof is sum forall in
3290df5507SBram Moolenaarsyn keyword dsStorageClass const
3390df5507SBram Moolenaarsyn keyword dsTodo         contained TODO FIXME XXX
34*76f3b1adSBram Moolenaarsyn keyword dsSql          sql sql_table sql_database sql_pragma sql_index
35*76f3b1adSBram Moolenaarsyn keyword dsSql          sql_integer sql_metadata sql_key foreign_key
3690df5507SBram Moolenaar
3790df5507SBram Moolenaar" dsCommentGroup allows adding matches for special things in comments.
3890df5507SBram Moolenaarsyn cluster dsCommentGroup  contains=dsTodo
3990df5507SBram Moolenaar
4090df5507SBram Moolenaarsyn match   dsOffset        display "^\s*[a-zA-Z_:\.][a-zA-Z0-9_:\.]*\s*:"
4190df5507SBram Moolenaar
4290df5507SBram Moolenaarsyn match   dsNumber        display "\<\d\+\>"
4390df5507SBram Moolenaarsyn match   dsNumberHex     display "\<0[xX]\x\+\>"
4490df5507SBram Moolenaarsyn match   dsNumberBin     display "\<[01]\+[bB]\>" contains=dsBinaryB
4590df5507SBram Moolenaarsyn match   dsBinaryB       display contained "[bB]\>"
4690df5507SBram Moolenaarsyn match   dsOctal         display "\<0\o\+\>" contains=dsOctalZero
4790df5507SBram Moolenaarsyn match   dsOctalZero     display contained "\<0"
4890df5507SBram Moolenaar
4990df5507SBram Moolenaarsyn match   dsOctalError    display "\<0\o*[89]\d*\>"
5090df5507SBram Moolenaar
5190df5507SBram Moolenaarsyn match   dsCommentError      display "\*/"
5290df5507SBram Moolenaarsyn match   dsCommentStartError display "/\*"me=e-1 contained
5390df5507SBram Moolenaar
5490df5507SBram Moolenaarsyn region   dsCommentL
5590df5507SBram Moolenaar  \ start="//" skip="\\$" end="$" keepend
5690df5507SBram Moolenaar  \ contains=@dsCommentGroup,@Spell
5790df5507SBram Moolenaarsyn region   dsComment
5890df5507SBram Moolenaar  \ matchgroup=dsCommentStart start="/\*" end="\*/"
5990df5507SBram Moolenaar  \ contains=@dsCommentGroup,dsCommentStartError,@Spell extend
6090df5507SBram Moolenaar
6190df5507SBram Moolenaarsyn region  dsString
6290df5507SBram Moolenaar  \ start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell
6390df5507SBram Moolenaar
6490df5507SBram Moolenaar" Define the default highlighting.
6590df5507SBram Moolenaarhi def link dsType              Type
6690df5507SBram Moolenaarhi def link dsEndian            StorageClass
6790df5507SBram Moolenaarhi def link dsStorageClass      StorageClass
6890df5507SBram Moolenaarhi def link dsAlign             Label
6990df5507SBram Moolenaarhi def link dsLabel             Label
7090df5507SBram Moolenaarhi def link dsOffset            Label
7190df5507SBram Moolenaarhi def link dsSql               PreProc
7290df5507SBram Moolenaarhi def link dsCompound          Structure
7390df5507SBram Moolenaarhi def link dsConditional       Conditional
74*76f3b1adSBram Moolenaarhi def link dsBoolean           Boolean
7590df5507SBram Moolenaarhi def link dsKeyword           Statement
7690df5507SBram Moolenaarhi def link dsString            String
7790df5507SBram Moolenaarhi def link dsNumber            Number
7890df5507SBram Moolenaarhi def link dsNumberBin         Number
7990df5507SBram Moolenaarhi def link dsBinaryB           Special
8090df5507SBram Moolenaarhi def link dsOctal             Number
8190df5507SBram Moolenaarhi def link dsOctalZero         Special
8290df5507SBram Moolenaarhi def link dsOctalError        Error
8390df5507SBram Moolenaarhi def link dsNumberHex         Number
8490df5507SBram Moolenaarhi def link dsTodo              Todo
8590df5507SBram Moolenaarhi def link dsOperator          Operator
8690df5507SBram Moolenaarhi def link dsPackage           Include
8790df5507SBram Moolenaarhi def link dsCommentError      Error
8890df5507SBram Moolenaarhi def link dsCommentStartError Error
8990df5507SBram Moolenaarhi def link dsCommentStart      dsComment
9090df5507SBram Moolenaarhi def link dsCommentL          dsComment
9190df5507SBram Moolenaarhi def link cCommentL           dsComment
9290df5507SBram Moolenaarhi def link dsComment           Comment
9390df5507SBram Moolenaar
9490df5507SBram Moolenaarlet b:current_syntax = "datascript"
959a7224b5SBram Moolenaar
969a7224b5SBram Moolenaarlet &cpo = s:keepcpo
979a7224b5SBram Moolenaarunlet s:keepcpo
98