annotate runtime/syntax/srec.vim @ 29576:04bc48a4ca6f v9.0.0129

patch 9.0.0129: compiler warning for int/size_t usage Commit: https://github.com/vim/vim/commit/ab146dac6b4148e770eb2bf61c72ef62d3ecfc65 Author: Mike Williams <mikew@globalgraphics.com> Date: Mon Aug 1 14:00:31 2022 +0100 patch 9.0.0129: compiler warning for int/size_t usage Problem: Compiler warning for int/size_t usage. Solution: Add a type cast. (Mike Williams, closes https://github.com/vim/vim/issues/10830)
author Bram Moolenaar <Bram@vim.org>
date Mon, 01 Aug 2022 15:15:03 +0200
parents 46763b01cd9a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6697
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
1 " Vim syntax file
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
2 " Language: Motorola S-Record
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
3 " Maintainer: Markus Heidelberg <markus.heidelberg@web.de>
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
4 " Last Change: 2015 Feb 24
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
5
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
6 " Each record (line) is built as follows:
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
7 "
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
8 " field digits states
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
9 "
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
10 " +----------+
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
11 " | start | 1 ('S') srecRecStart
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
12 " +----------+
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
13 " | type | 1 srecRecType, (srecRecTypeUnknown)
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
14 " +----------+
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
15 " | count | 2 srecByteCount
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
16 " +----------+
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
17 " | address | 4/6/8 srecNoAddress, srecDataAddress, srecRecCount, srecStartAddress, (srecAddressFieldUnknown)
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
18 " +----------+
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
19 " | data | 0..504/502/500 srecDataOdd, srecDataEven, (srecDataUnexpected)
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
20 " +----------+
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
21 " | checksum | 2 srecChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
22 " +----------+
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
23 "
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
24 " States in parentheses in the upper format description indicate that they
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
25 " should not appear in a valid file.
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
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
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
29 finish
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
30 endif
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
31
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
32 syn match srecRecStart "^S"
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
33
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
34 syn match srecRecTypeUnknown "^S." contains=srecRecStart
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
35 syn match srecRecType "^S[0-35-9]" contains=srecRecStart
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
36
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
37 syn match srecByteCount "^S.[0-9a-fA-F]\{2}" contains=srecRecTypeUnknown nextgroup=srecAddressFieldUnknown,srecChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
38 syn match srecByteCount "^S[0-35-9][0-9a-fA-F]\{2}" contains=srecRecType
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
39
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
40 syn match srecAddressFieldUnknown "[0-9a-fA-F]\{2}" contained nextgroup=srecAddressFieldUnknown,srecChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
41
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
42 syn match srecNoAddress "^S0[0-9a-fA-F]\{6}" contains=srecByteCount nextgroup=srecDataOdd,srecChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
43 syn match srecDataAddress "^S1[0-9a-fA-F]\{6}" contains=srecByteCount nextgroup=srecDataOdd,srecChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
44 syn match srecDataAddress "^S2[0-9a-fA-F]\{8}" contains=srecByteCount nextgroup=srecDataOdd,srecChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
45 syn match srecDataAddress "^S3[0-9a-fA-F]\{10}" contains=srecByteCount nextgroup=srecDataOdd,srecChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
46 syn match srecRecCount "^S5[0-9a-fA-F]\{6}" contains=srecByteCount nextgroup=srecDataUnexpected,srecChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
47 syn match srecRecCount "^S6[0-9a-fA-F]\{8}" contains=srecByteCount nextgroup=srecDataUnexpected,srecChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
48 syn match srecStartAddress "^S7[0-9a-fA-F]\{10}" contains=srecByteCount nextgroup=srecDataUnexpected,srecChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
49 syn match srecStartAddress "^S8[0-9a-fA-F]\{8}" contains=srecByteCount nextgroup=srecDataUnexpected,srecChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
50 syn match srecStartAddress "^S9[0-9a-fA-F]\{6}" contains=srecByteCount nextgroup=srecDataUnexpected,srecChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
51
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
52 " alternating highlight per byte for easier reading
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
53 syn match srecDataOdd "[0-9a-fA-F]\{2}" contained nextgroup=srecDataEven,srecChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
54 syn match srecDataEven "[0-9a-fA-F]\{2}" contained nextgroup=srecDataOdd,srecChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
55 " data bytes which should not exist
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
56 syn match srecDataUnexpected "[0-9a-fA-F]\{2}" contained nextgroup=srecDataUnexpected,srecChecksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
57 " Data digit pair regex usage also results in only highlighting the checksum
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
58 " if the number of data characters is even.
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
59
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
60 syn match srecChecksum "[0-9a-fA-F]\{2}$" contained
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
61
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
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
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
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
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
79
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
80
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
81 let b:current_syntax = "srec"
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
82
12155a47f6c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
83 " vim: ts=8