annotate runtime/syntax/srec.vim @ 33988:7c30841c60a0 v9.0.2180

patch 9.0.2180: POSIX function name in exarg causes issues Commit: https://github.com/vim/vim/commit/6fdb6280821a822768df5689a5d727e37d38306c Author: Zoltan Arpadffy <zoltan.arpadffy@gmail.com> Date: Tue Dec 19 20:53:07 2023 +0100 patch 9.0.2180: POSIX function name in exarg causes issues Problem: POSIX function name in exarg struct causes issues on OpenVMS Solution: Rename getline member in exarg struct to ea_getline, remove isinf() workaround for VMS There are compilers that do not treat well POSIX functions - like getline - usage in the structs. Older VMS compilers could digest this... but the newer OpenVMS compilers ( like VSI C x86-64 X7.4-843 (GEM 50XB9) ) cannot deal with these structs. This could be limited to getline() that is defined via getdelim() and might not affect all POSIX functions in general - but avoiding POSIX function names usage in the structs is a "safe side" practice without compromising the functionality or the code readability. The previous OpenVMS X86 port used a workaround limiting the compiler capabilities using __CRTL_VER_OVERRIDE=80400000 In order to make the OpenVMS port future proof, this pull request proposes a possible solution. closes: #13704 Signed-off-by: Zoltan Arpadffy <zoltan.arpadffy@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Tue, 19 Dec 2023 21:00:04 +0100
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