annotate runtime/syntax/hex.vim @ 9638:af0d98d8836e v7.4.2096

commit https://github.com/vim/vim/commit/b49edc11a1872fa99befa9a4a8ea6c8537868038 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jul 23 15:47:34 2016 +0200 patch 7.4.2096 Problem: Lambda functions show up with completion. Solution: Don't show lambda functions. (Ken Takata)
author Christian Brabandt <cb@256bit.org>
date Sat, 23 Jul 2016 16:00:06 +0200
parents 12155a47f6c2
children 43efa4f5a8ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
6697
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
2 " Language: Intel HEX
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
3 " Maintainer: Markus Heidelberg <markus.heidelberg@web.de>
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
4 " Previous version: Sams Ricahrd <sams@ping.at>
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
5 " Last Change: 2015 Feb 24
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
6
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
7 " Each record (line) is built as follows:
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
8 "
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
9 " field digits states
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
10 "
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
11 " +----------+
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
12 " | start | 1 (':') hexRecStart
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
13 " +----------+
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
14 " | count | 2 hexDataByteCount
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
15 " +----------+
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
16 " | address | 4 hexNoAddress, hexDataAddress, (hexAddressFieldUnknown)
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
17 " +----------+
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
18 " | type | 2 hexRecType, (hexRecTypeUnknown)
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
19 " +----------+
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
20 " | data | 0..510 hexDataOdd, hexDataEven, hexExtendedAddress, hexStartAddress, (hexDataFieldUnknown, hexDataUnexpected)
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
21 " +----------+
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
22 " | checksum | 2 hexChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
23 " +----------+
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
24 "
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
25 " States in parentheses in the upper format description indicate that they
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
26 " should not appear in a valid file.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
6697
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
36 syn match hexRecStart "^:"
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
37
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
38 syn match hexDataByteCount "^:[0-9a-fA-F]\{2}" contains=hexRecStart nextgroup=hexAddress
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39
6697
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
40 syn match hexAddress "[0-9a-fA-F]\{4}" transparent contained nextgroup=hexRecTypeUnknown,hexRecType
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
41 " The address field groups include the record type field in the last 2
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
42 " characters, the proper match for highlighting follows below.
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
43 syn match hexAddressFieldUnknown "^:[0-9a-fA-F]\{8}" contains=hexDataByteCount nextgroup=hexDataFieldUnknown,hexChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
44 syn match hexDataAddress "^:[0-9a-fA-F]\{6}00" contains=hexDataByteCount nextgroup=hexDataOdd,hexChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
45 syn match hexNoAddress "^:[0-9a-fA-F]\{6}01" contains=hexDataByteCount nextgroup=hexDataUnexpected,hexChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
46 syn match hexNoAddress "^:[0-9a-fA-F]\{6}0[24]" contains=hexDataByteCount nextgroup=hexExtendedAddress
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
47 syn match hexNoAddress "^:[0-9a-fA-F]\{6}0[35]" contains=hexDataByteCount nextgroup=hexStartAddress
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
48
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
49 syn match hexRecTypeUnknown "[0-9a-fA-F]\{2}" contained
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
50 syn match hexRecType "0[0-5]" contained
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51
6697
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
52 syn match hexDataFieldUnknown "[0-9a-fA-F]\{2}" contained nextgroup=hexDataFieldUnknown,hexChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
53 " alternating highlight per byte for easier reading
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
54 syn match hexDataOdd "[0-9a-fA-F]\{2}" contained nextgroup=hexDataEven,hexChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
55 syn match hexDataEven "[0-9a-fA-F]\{2}" contained nextgroup=hexDataOdd,hexChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
56 " data bytes which should not exist
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
57 syn match hexDataUnexpected "[0-9a-fA-F]\{2}" contained nextgroup=hexDataUnexpected,hexChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
58 " Data digit pair regex usage also results in only highlighting the checksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
59 " if the number of data characters is even.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60
6697
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
61 " special data fields
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
62 syn match hexExtendedAddress "[0-9a-fA-F]\{4}" contained nextgroup=hexDataUnexpected,hexChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
63 syn match hexStartAddress "[0-9a-fA-F]\{8}" contained nextgroup=hexDataUnexpected,hexChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
64
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
65 syn match hexChecksum "[0-9a-fA-F]\{2}$" contained
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
66
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
67 " Folding Data Records below an Extended Segment/Linear Address Record
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
68 syn region hexExtAdrBlock start="^:[0-9a-fA-F]\{7}[24]" skip="^:[0-9a-fA-F]\{7}0" end="^:"me=s-1 fold transparent
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 if version >= 508 || !exists("did_hex_syntax_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 let did_hex_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80
6697
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
81 " The default methods for highlighting. Can be overridden later
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
82 HiLink hexRecStart hexRecType
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
83 HiLink hexDataByteCount Constant
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
84 hi def hexAddressFieldUnknown term=italic cterm=italic gui=italic
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
85 HiLink hexDataAddress Comment
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
86 HiLink hexNoAddress DiffAdd
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
87 HiLink hexRecTypeUnknown hexRecType
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
88 HiLink hexRecType WarningMsg
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
89 hi def hexDataFieldUnknown term=italic cterm=italic gui=italic
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
90 hi def hexDataOdd term=bold cterm=bold gui=bold
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
91 hi def hexDataEven term=NONE cterm=NONE gui=NONE
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
92 HiLink hexDataUnexpected Error
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
93 HiLink hexExtendedAddress hexDataAddress
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
94 HiLink hexStartAddress hexDataAddress
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
95 HiLink hexChecksum DiffChange
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 let b:current_syntax = "hex"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 " vim: ts=8