190df5507SBram Moolenaar" Vim syntax file 290df5507SBram Moolenaar" Language: Datascript 390df5507SBram Moolenaar" Maintainer: Dominique Pelle <[email protected]> 4*9a7224b5SBram Moolenaar" Last Change: 2012 Apr 30 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 15*9a7224b5SBram Moolenaarlet s:keepcpo= &cpo 16*9a7224b5SBram Moolenaarset cpo&vim 1790df5507SBram Moolenaar 1890df5507SBram Moolenaarsyn keyword dsPackage import package 1990df5507SBram Moolenaarsyn keyword dsType bit string 2090df5507SBram Moolenaarsyn keyword dsType 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 2890df5507SBram Moolenaarsyn keyword dsCompound union choice on enum bitmask subtype 2990df5507SBram Moolenaarsyn keyword dsKeyword function return 3090df5507SBram Moolenaarsyn keyword dsOperator sizeof bitsizeof lengthof is sum forall in 3190df5507SBram Moolenaarsyn keyword dsStorageClass const 3290df5507SBram Moolenaarsyn keyword dsTodo contained TODO FIXME XXX 3390df5507SBram Moolenaarsyn keyword dsSql sql sql_table sql_database sql_pragma 3490df5507SBram Moolenaarsyn keyword dsSql sql_integer sql_metadata sql_key 3590df5507SBram Moolenaar 3690df5507SBram Moolenaar" dsCommentGroup allows adding matches for special things in comments. 3790df5507SBram Moolenaarsyn cluster dsCommentGroup contains=dsTodo 3890df5507SBram Moolenaar 3990df5507SBram Moolenaarsyn match dsOffset display "^\s*[a-zA-Z_:\.][a-zA-Z0-9_:\.]*\s*:" 4090df5507SBram Moolenaar 4190df5507SBram Moolenaarsyn match dsNumber display "\<\d\+\>" 4290df5507SBram Moolenaarsyn match dsNumberHex display "\<0[xX]\x\+\>" 4390df5507SBram Moolenaarsyn match dsNumberBin display "\<[01]\+[bB]\>" contains=dsBinaryB 4490df5507SBram Moolenaarsyn match dsBinaryB display contained "[bB]\>" 4590df5507SBram Moolenaarsyn match dsOctal display "\<0\o\+\>" contains=dsOctalZero 4690df5507SBram Moolenaarsyn match dsOctalZero display contained "\<0" 4790df5507SBram Moolenaar 4890df5507SBram Moolenaarsyn match dsOctalError display "\<0\o*[89]\d*\>" 4990df5507SBram Moolenaar 5090df5507SBram Moolenaarsyn match dsCommentError display "\*/" 5190df5507SBram Moolenaarsyn match dsCommentStartError display "/\*"me=e-1 contained 5290df5507SBram Moolenaar 5390df5507SBram Moolenaarsyn region dsCommentL 5490df5507SBram Moolenaar \ start="//" skip="\\$" end="$" keepend 5590df5507SBram Moolenaar \ contains=@dsCommentGroup,@Spell 5690df5507SBram Moolenaarsyn region dsComment 5790df5507SBram Moolenaar \ matchgroup=dsCommentStart start="/\*" end="\*/" 5890df5507SBram Moolenaar \ contains=@dsCommentGroup,dsCommentStartError,@Spell extend 5990df5507SBram Moolenaar 6090df5507SBram Moolenaarsyn region dsString 6190df5507SBram Moolenaar \ start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell 6290df5507SBram Moolenaar 6390df5507SBram Moolenaar" Define the default highlighting. 6490df5507SBram Moolenaarhi def link dsType Type 6590df5507SBram Moolenaarhi def link dsEndian StorageClass 6690df5507SBram Moolenaarhi def link dsStorageClass StorageClass 6790df5507SBram Moolenaarhi def link dsAlign Label 6890df5507SBram Moolenaarhi def link dsLabel Label 6990df5507SBram Moolenaarhi def link dsOffset Label 7090df5507SBram Moolenaarhi def link dsSql PreProc 7190df5507SBram Moolenaarhi def link dsCompound Structure 7290df5507SBram Moolenaarhi def link dsConditional Conditional 7390df5507SBram Moolenaarhi def link dsKeyword Statement 7490df5507SBram Moolenaarhi def link dsString String 7590df5507SBram Moolenaarhi def link dsNumber Number 7690df5507SBram Moolenaarhi def link dsNumberBin Number 7790df5507SBram Moolenaarhi def link dsBinaryB Special 7890df5507SBram Moolenaarhi def link dsOctal Number 7990df5507SBram Moolenaarhi def link dsOctalZero Special 8090df5507SBram Moolenaarhi def link dsOctalError Error 8190df5507SBram Moolenaarhi def link dsNumberHex Number 8290df5507SBram Moolenaarhi def link dsTodo Todo 8390df5507SBram Moolenaarhi def link dsOperator Operator 8490df5507SBram Moolenaarhi def link dsPackage Include 8590df5507SBram Moolenaarhi def link dsCommentError Error 8690df5507SBram Moolenaarhi def link dsCommentStartError Error 8790df5507SBram Moolenaarhi def link dsCommentStart dsComment 8890df5507SBram Moolenaarhi def link dsCommentL dsComment 8990df5507SBram Moolenaarhi def link cCommentL dsComment 9090df5507SBram Moolenaarhi def link dsComment Comment 9190df5507SBram Moolenaar 9290df5507SBram Moolenaarlet b:current_syntax = "datascript" 93*9a7224b5SBram Moolenaar 94*9a7224b5SBram Moolenaarlet &cpo = s:keepcpo 95*9a7224b5SBram Moolenaarunlet s:keepcpo 96