annotate runtime/syntax/datascript.vim @ 5502:5ad60cd88339 v7.4.100

updated for version 7.4.100 Problem: NFA regexp doesn't handle backreference correctly. (Ryuichi Hayashida, Urtica Dioica) Solution: Always add NFA_SKIP, also when it already exists at the start position.
author Bram Moolenaar <bram@vim.org>
date Thu, 21 Nov 2013 16:03:40 +0100
parents d1e4abe8342c
children c52a655d927d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2467
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
1 " Vim syntax file
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
2 " Language: Datascript
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
3 " Maintainer: Dominique Pelle <dominique.pelle@gmail.com>
3496
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2467
diff changeset
4 " Last Change: 2012 Apr 30
2467
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
5 "
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
6 " DataScript is a formal language for modelling binary datatypes,
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
7 " bitstreams or file formats. For more information, see:
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
8 " http://datascript.berlios.de/DataScriptLanguageOverview.html
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
9
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
10 if version < 600
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
11 syntax clear
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
12 elseif exists("b:current_syntax")
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
13 finish
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
14 endif
3496
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2467
diff changeset
15 let s:keepcpo= &cpo
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2467
diff changeset
16 set cpo&vim
2467
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
17
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
18 syn keyword dsPackage import package
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
19 syn keyword dsType bit string
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
20 syn keyword dsType int8 int16 int32 int64
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
21 syn keyword dsType uint8 uint16 uint32 uint64
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
22 syn keyword dsType leint16 leint32 leint64
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
23 syn keyword dsType leuint16 leuint32 leuint64
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
24 syn keyword dsEndian little big
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
25 syn keyword dsAlign align
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
26 syn keyword dsLabel case default
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
27 syn keyword dsConditional if condition
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
28 syn keyword dsCompound union choice on enum bitmask subtype
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
29 syn keyword dsKeyword function return
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
30 syn keyword dsOperator sizeof bitsizeof lengthof is sum forall in
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
31 syn keyword dsStorageClass const
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
32 syn keyword dsTodo contained TODO FIXME XXX
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
33 syn keyword dsSql sql sql_table sql_database sql_pragma
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
34 syn keyword dsSql sql_integer sql_metadata sql_key
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
35
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
36 " dsCommentGroup allows adding matches for special things in comments.
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
37 syn cluster dsCommentGroup contains=dsTodo
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
38
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
39 syn match dsOffset display "^\s*[a-zA-Z_:\.][a-zA-Z0-9_:\.]*\s*:"
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
40
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
41 syn match dsNumber display "\<\d\+\>"
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
42 syn match dsNumberHex display "\<0[xX]\x\+\>"
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
43 syn match dsNumberBin display "\<[01]\+[bB]\>" contains=dsBinaryB
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
44 syn match dsBinaryB display contained "[bB]\>"
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
45 syn match dsOctal display "\<0\o\+\>" contains=dsOctalZero
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
46 syn match dsOctalZero display contained "\<0"
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
47
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
48 syn match dsOctalError display "\<0\o*[89]\d*\>"
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
49
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
50 syn match dsCommentError display "\*/"
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
51 syn match dsCommentStartError display "/\*"me=e-1 contained
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
52
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
53 syn region dsCommentL
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
54 \ start="//" skip="\\$" end="$" keepend
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
55 \ contains=@dsCommentGroup,@Spell
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
56 syn region dsComment
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
57 \ matchgroup=dsCommentStart start="/\*" end="\*/"
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
58 \ contains=@dsCommentGroup,dsCommentStartError,@Spell extend
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
59
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
60 syn region dsString
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
61 \ start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
62
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
63 " Define the default highlighting.
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
64 hi def link dsType Type
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
65 hi def link dsEndian StorageClass
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
66 hi def link dsStorageClass StorageClass
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
67 hi def link dsAlign Label
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
68 hi def link dsLabel Label
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
69 hi def link dsOffset Label
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
70 hi def link dsSql PreProc
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
71 hi def link dsCompound Structure
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
72 hi def link dsConditional Conditional
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
73 hi def link dsKeyword Statement
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
74 hi def link dsString String
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
75 hi def link dsNumber Number
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
76 hi def link dsNumberBin Number
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
77 hi def link dsBinaryB Special
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
78 hi def link dsOctal Number
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
79 hi def link dsOctalZero Special
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
80 hi def link dsOctalError Error
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
81 hi def link dsNumberHex Number
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
82 hi def link dsTodo Todo
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
83 hi def link dsOperator Operator
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
84 hi def link dsPackage Include
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
85 hi def link dsCommentError Error
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
86 hi def link dsCommentStartError Error
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
87 hi def link dsCommentStart dsComment
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
88 hi def link dsCommentL dsComment
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
89 hi def link cCommentL dsComment
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
90 hi def link dsComment Comment
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
91
9c8d603fd4d1 Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
92 let b:current_syntax = "datascript"
3496
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2467
diff changeset
93
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2467
diff changeset
94 let &cpo = s:keepcpo
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2467
diff changeset
95 unlet s:keepcpo