Mercurial > vim
annotate runtime/syntax/srec.vim @ 23465:58bad104e7ee
Added tag v8.2.2275 for changeset a0fc1411457650a66b36794b8be8f61288aad869
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 02 Jan 2021 16:30:04 +0100 |
parents | 46763b01cd9a |
children |
rev | line source |
---|---|
6697 | 1 " Vim syntax file |
2 " Language: Motorola S-Record | |
3 " Maintainer: Markus Heidelberg <markus.heidelberg@web.de> | |
4 " Last Change: 2015 Feb 24 | |
5 | |
6 " Each record (line) is built as follows: | |
7 " | |
8 " field digits states | |
9 " | |
10 " +----------+ | |
11 " | start | 1 ('S') srecRecStart | |
12 " +----------+ | |
13 " | type | 1 srecRecType, (srecRecTypeUnknown) | |
14 " +----------+ | |
15 " | count | 2 srecByteCount | |
16 " +----------+ | |
17 " | address | 4/6/8 srecNoAddress, srecDataAddress, srecRecCount, srecStartAddress, (srecAddressFieldUnknown) | |
18 " +----------+ | |
19 " | data | 0..504/502/500 srecDataOdd, srecDataEven, (srecDataUnexpected) | |
20 " +----------+ | |
21 " | checksum | 2 srecChecksum | |
22 " +----------+ | |
23 " | |
24 " States in parentheses in the upper format description indicate that they | |
25 " should not appear in a valid file. | |
26 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6697
diff
changeset
|
27 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6697
diff
changeset
|
28 if exists("b:current_syntax") |
6697 | 29 finish |
30 endif | |
31 | |
32 syn match srecRecStart "^S" | |
33 | |
34 syn match srecRecTypeUnknown "^S." contains=srecRecStart | |
35 syn match srecRecType "^S[0-35-9]" contains=srecRecStart | |
36 | |
37 syn match srecByteCount "^S.[0-9a-fA-F]\{2}" contains=srecRecTypeUnknown nextgroup=srecAddressFieldUnknown,srecChecksum | |
38 syn match srecByteCount "^S[0-35-9][0-9a-fA-F]\{2}" contains=srecRecType | |
39 | |
40 syn match srecAddressFieldUnknown "[0-9a-fA-F]\{2}" contained nextgroup=srecAddressFieldUnknown,srecChecksum | |
41 | |
42 syn match srecNoAddress "^S0[0-9a-fA-F]\{6}" contains=srecByteCount nextgroup=srecDataOdd,srecChecksum | |
43 syn match srecDataAddress "^S1[0-9a-fA-F]\{6}" contains=srecByteCount nextgroup=srecDataOdd,srecChecksum | |
44 syn match srecDataAddress "^S2[0-9a-fA-F]\{8}" contains=srecByteCount nextgroup=srecDataOdd,srecChecksum | |
45 syn match srecDataAddress "^S3[0-9a-fA-F]\{10}" contains=srecByteCount nextgroup=srecDataOdd,srecChecksum | |
46 syn match srecRecCount "^S5[0-9a-fA-F]\{6}" contains=srecByteCount nextgroup=srecDataUnexpected,srecChecksum | |
47 syn match srecRecCount "^S6[0-9a-fA-F]\{8}" contains=srecByteCount nextgroup=srecDataUnexpected,srecChecksum | |
48 syn match srecStartAddress "^S7[0-9a-fA-F]\{10}" contains=srecByteCount nextgroup=srecDataUnexpected,srecChecksum | |
49 syn match srecStartAddress "^S8[0-9a-fA-F]\{8}" contains=srecByteCount nextgroup=srecDataUnexpected,srecChecksum | |
50 syn match srecStartAddress "^S9[0-9a-fA-F]\{6}" contains=srecByteCount nextgroup=srecDataUnexpected,srecChecksum | |
51 | |
52 " alternating highlight per byte for easier reading | |
53 syn match srecDataOdd "[0-9a-fA-F]\{2}" contained nextgroup=srecDataEven,srecChecksum | |
54 syn match srecDataEven "[0-9a-fA-F]\{2}" contained nextgroup=srecDataOdd,srecChecksum | |
55 " data bytes which should not exist | |
56 syn match srecDataUnexpected "[0-9a-fA-F]\{2}" contained nextgroup=srecDataUnexpected,srecChecksum | |
57 " Data digit pair regex usage also results in only highlighting the checksum | |
58 " if the number of data characters is even. | |
59 | |
60 syn match srecChecksum "[0-9a-fA-F]\{2}$" contained | |
61 | |
62 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6697
diff
changeset
|
63 " Only when an item doesn't have highlighting yet |
6697 | 64 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6697
diff
changeset
|
65 " The default methods for highlighting. Can be overridden later |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
66 hi def link srecRecStart srecRecType |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
67 hi def link srecRecTypeUnknown srecRecType |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
68 hi def link srecRecType WarningMsg |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
69 hi def link srecByteCount Constant |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6697
diff
changeset
|
70 hi def srecAddressFieldUnknown term=italic cterm=italic gui=italic |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
71 hi def link srecNoAddress DiffAdd |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
72 hi def link srecDataAddress Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
73 hi def link srecRecCount srecNoAddress |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
74 hi def link srecStartAddress srecDataAddress |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6697
diff
changeset
|
75 hi def srecDataOdd term=bold cterm=bold gui=bold |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6697
diff
changeset
|
76 hi def srecDataEven term=NONE cterm=NONE gui=NONE |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
77 hi def link srecDataUnexpected Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
78 hi def link srecChecksum DiffChange |
6697 | 79 |
80 | |
81 let b:current_syntax = "srec" | |
82 | |
83 " vim: ts=8 |