annotate runtime/syntax/lss.vim @ 34074:1629cc65d78d v9.1.0006

patch 9.1.0006: is*() and to*() function may be unsafe Commit: https://github.com/vim/vim/commit/184f71cc6868a240dc872ed2852542bbc1d43e28 Author: Keith Thompson <Keith.S.Thompson@gmail.com> Date: Thu Jan 4 21:19:04 2024 +0100 patch 9.1.0006: is*() and to*() function may be unsafe Problem: is*() and to*() function may be unsafe Solution: Add SAFE_* macros and start using those instead (Keith Thompson) Use SAFE_() macros for is*() and to*() functions The standard is*() and to*() functions declared in <ctype.h> have undefined behavior for negative arguments other than EOF. If plain char is signed, passing an unchecked value from argv for from user input to one of these functions has undefined behavior. Solution: Add SAFE_*() macros that cast the argument to unsigned char. Most implementations behave sanely for negative arguments, and most character values in practice are non-negative, but it's still best to avoid undefined behavior. The change from #13347 has been omitted, as this has already been separately fixed in commit ac709e2fc0db6d31abb7da96f743c40956b60c3a (v9.0.2054) fixes: #13332 closes: #13347 Signed-off-by: Keith Thompson <Keith.S.Thompson@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Thu, 04 Jan 2024 21:30:04 +0100
parents d46f974fd69e
children
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: Lynx 2.7.1 style file
26
404aac550f35 updated for version 7.0017
vimboss
parents: 7
diff changeset
3 " Maintainer: Scott Bigham <dsb@killerbunnies.org>
404aac550f35 updated for version 7.0017
vimboss
parents: 7
diff changeset
4 " Last Change: 2004 Oct 06
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
6 " quit when a syntax file was already loaded
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
7 if exists("b:current_syntax")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " This setup is probably atypical for a syntax highlighting file, because
32974
d46f974fd69e runtime: Fix typos in various files
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
12 " most of it is not really intended to be overridable. Instead, the
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 " highlighting is supposed to correspond to the highlighting specified by
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 " the .lss file entries themselves; ie. the "bold" keyword should be bold,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 " the "red" keyword should be red, and so forth. The exceptions to this
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 " are comments, of course, and the initial keyword identifying the affected
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " element, which will inherit the usual Identifier highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 syn match lssElement "^[^:]\+" nextgroup=lssMono
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 syn match lssMono ":[^:]\+" contained nextgroup=lssFgColor contains=lssReverse,lssUnderline,lssBold,lssStandout
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 syn keyword lssBold bold contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 syn keyword lssReverse reverse contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn keyword lssUnderline underline contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn keyword lssStandout standout contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn match lssFgColor ":[^:]\+" contained nextgroup=lssBgColor contains=lssRedFg,lssBlueFg,lssGreenFg,lssBrownFg,lssMagentaFg,lssCyanFg,lssLightgrayFg,lssGrayFg,lssBrightredFg,lssBrightgreenFg,lssYellowFg,lssBrightblueFg,lssBrightmagentaFg,lssBrightcyanFg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn keyword lssRedFg red contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn keyword lssBlueFg blue contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn keyword lssGreenFg green contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn keyword lssBrownFg brown contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn keyword lssMagentaFg magenta contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn keyword lssCyanFg cyan contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn keyword lssLightgrayFg lightgray contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn keyword lssGrayFg gray contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn keyword lssBrightredFg brightred contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn keyword lssBrightgreenFg brightgreen contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn keyword lssYellowFg yellow contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn keyword lssBrightblueFg brightblue contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn keyword lssBrightmagentaFg brightmagenta contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn keyword lssBrightcyanFg brightcyan contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn match lssBgColor ":[^:]\+" contained contains=lssRedBg,lssBlueBg,lssGreenBg,lssBrownBg,lssMagentaBg,lssCyanBg,lssLightgrayBg,lssGrayBg,lssBrightredBg,lssBrightgreenBg,lssYellowBg,lssBrightblueBg,lssBrightmagentaBg,lssBrightcyanBg,lssWhiteBg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn keyword lssRedBg red contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn keyword lssBlueBg blue contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn keyword lssGreenBg green contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn keyword lssBrownBg brown contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn keyword lssMagentaBg magenta contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn keyword lssCyanBg cyan contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn keyword lssLightgrayBg lightgray contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 syn keyword lssGrayBg gray contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syn keyword lssBrightredBg brightred contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 syn keyword lssBrightgreenBg brightgreen contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 syn keyword lssYellowBg yellow contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn keyword lssBrightblueBg brightblue contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 syn keyword lssBrightmagentaBg brightmagenta contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 syn keyword lssBrightcyanBg brightcyan contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 syn keyword lssWhiteBg white contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 syn match lssComment "#.*$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 " Define the default highlighting.
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
70 " Only when an item doesn't have highlighting yet
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
71 hi def link lssComment Comment
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
72 hi def link lssElement Identifier
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
74 hi def lssBold term=bold cterm=bold
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
75 hi def lssReverse term=reverse cterm=reverse
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
76 hi def lssUnderline term=underline cterm=underline
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
77 hi def lssStandout term=standout cterm=standout
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
79 hi def lssRedFg ctermfg=red
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
80 hi def lssBlueFg ctermfg=blue
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
81 hi def lssGreenFg ctermfg=green
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
82 hi def lssBrownFg ctermfg=brown
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
83 hi def lssMagentaFg ctermfg=magenta
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
84 hi def lssCyanFg ctermfg=cyan
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
85 hi def lssGrayFg ctermfg=gray
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
86 if $COLORTERM == "rxvt"
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
87 " On rxvt's, bright colors are activated by setting the bold attribute.
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
88 hi def lssLightgrayFg ctermfg=gray cterm=bold
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
89 hi def lssBrightredFg ctermfg=red cterm=bold
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
90 hi def lssBrightgreenFg ctermfg=green cterm=bold
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
91 hi def lssYellowFg ctermfg=yellow cterm=bold
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
92 hi def lssBrightblueFg ctermfg=blue cterm=bold
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
93 hi def lssBrightmagentaFg ctermfg=magenta cterm=bold
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
94 hi def lssBrightcyanFg ctermfg=cyan cterm=bold
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
95 else
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
96 hi def lssLightgrayFg ctermfg=lightgray
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
97 hi def lssBrightredFg ctermfg=lightred
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
98 hi def lssBrightgreenFg ctermfg=lightgreen
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
99 hi def lssYellowFg ctermfg=yellow
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
100 hi def lssBrightblueFg ctermfg=lightblue
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
101 hi def lssBrightmagentaFg ctermfg=lightmagenta
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
102 hi def lssBrightcyanFg ctermfg=lightcyan
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
103 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
105 hi def lssRedBg ctermbg=red
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
106 hi def lssBlueBg ctermbg=blue
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
107 hi def lssGreenBg ctermbg=green
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
108 hi def lssBrownBg ctermbg=brown
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
109 hi def lssMagentaBg ctermbg=magenta
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
110 hi def lssCyanBg ctermbg=cyan
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
111 hi def lssLightgrayBg ctermbg=lightgray
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
112 hi def lssGrayBg ctermbg=gray
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
113 hi def lssBrightredBg ctermbg=lightred
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
114 hi def lssBrightgreenBg ctermbg=lightgreen
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
115 hi def lssYellowBg ctermbg=yellow
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
116 hi def lssBrightblueBg ctermbg=lightblue
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
117 hi def lssBrightmagentaBg ctermbg=lightmagenta
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
118 hi def lssBrightcyanBg ctermbg=lightcyan
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 26
diff changeset
119 hi def lssWhiteBg ctermbg=white ctermfg=black
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 let b:current_syntax = "lss"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 " vim: ts=8