Mercurial > vim
annotate runtime/syntax/tsscl.vim @ 16362:514e42de6a1d v8.1.1186
patch 8.1.1186: readdir() allocates list twice
commit https://github.com/vim/vim/commit/334ad415040f9592451ec99498cd99f90d6e33e6
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Apr 19 15:20:46 2019 +0200
patch 8.1.1186: readdir() allocates list twice
Problem: readdir() allocates list twice.
Solution: Remove second allocation. Also check for zero length.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 19 Apr 2019 15:30:05 +0200 |
parents | 46763b01cd9a |
children | d6dde6229b36 |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: TSS (Thermal Synthesizer System) Command Line | |
3 " Maintainer: Adrian Nagle, anagle@ball.com | |
4 " Last Change: 2003 May 11 | |
5 " Filenames: *.tsscl | |
6 " URL: http://www.naglenet.org/vim/syntax/tsscl.vim | |
7 " MAIN URL: http://www.naglenet.org/vim/ | |
8 | |
9 | |
10 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
11 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
12 if exists("b:current_syntax") |
7 | 13 finish |
14 endif | |
15 | |
16 | |
17 | |
18 " Ignore case | |
19 syn case ignore | |
20 | |
21 | |
22 | |
23 " | |
24 " | |
25 " Begin syntax definitions for tss geomtery file. | |
26 " | |
27 | |
28 " Load TSS geometry syntax file | |
29 "source $VIM/myvim/tssgm.vim | |
30 "source $VIMRUNTIME/syntax/c.vim | |
31 | |
32 " Define keywords for TSS | |
33 syn keyword tssclCommand begin radk list heatrates attr draw | |
34 | |
35 syn keyword tssclKeyword cells rays error nodes levels objects cpu | |
36 syn keyword tssclKeyword units length positions energy time unit solar | |
37 syn keyword tssclKeyword solar_constant albedo planet_power | |
38 | |
39 syn keyword tssclEnd exit | |
40 | |
41 syn keyword tssclUnits cm feet meters inches | |
42 syn keyword tssclUnits Celsius Kelvin Fahrenheit Rankine | |
43 | |
44 | |
45 | |
46 " Define matches for TSS | |
47 syn match tssclString /"[^"]\+"/ contains=ALLBUT,tssInteger,tssclKeyword,tssclCommand,tssclEnd,tssclUnits | |
48 | |
49 syn match tssclComment "#.*$" | |
50 | |
51 " rational and logical operators | |
52 " < Less than | |
53 " > Greater than | |
54 " <= Less than or equal | |
55 " >= Greater than or equal | |
56 " == or = Equal to | |
57 " != Not equal to | |
58 " && or & Logical AND | |
59 " || or | Logical OR | |
60 " ! Logical NOT | |
61 " | |
62 " algebraic operators: | |
63 " ^ or ** Exponentation | |
64 " * Multiplication | |
65 " / Division | |
66 " % Remainder | |
67 " + Addition | |
68 " - Subtraction | |
69 " | |
70 syn match tssclOper "||\||\|&&\|&\|!=\|!\|>=\|<=\|>\|<\|+\|-\|^\|\*\*\|\*\|/\|%\|==\|=\|\." skipwhite | |
71 | |
72 " CLI Directive Commands, with arguments | |
73 " | |
74 " BASIC COMMAND LIST | |
75 " *ADD input_source | |
76 " *ARITHMETIC { [ON] | OFF } | |
77 " *CLOSE unit_number | |
78 " *CPU | |
79 " *DEFINE | |
80 " *ECHO[/qualifiers] { [ON] | OFF } | |
81 " *ELSE [IF { 0 | 1 } ] | |
82 " *END { IF | WHILE } | |
83 " *EXIT | |
84 " *IF { 0 | 1 } | |
85 " *LIST/n list variable | |
86 " *OPEN[/r | /r+ | /w | /w+ ] unit_number file_name | |
87 " *PROMPT prompt_string sybol_name | |
88 " *READ/unit=unit_number[/LOCAL | /GLOBAL ] sym1 [sym2, [sym3 ...]] | |
89 " *REWIND | |
90 " *STOP | |
91 " *STRCMP string_1 string_2 difference | |
92 " *SYSTEM command | |
93 " *UNDEFINE[/LOCAL][/GLOBAL] symbol_name | |
94 " *WHILE { 0 | 1 } | |
95 " *WRITE[/unit=unit_number] output text | |
96 " | |
97 syn match tssclDirective "\*ADD" | |
98 syn match tssclDirective "\*ARITHMETIC \+\(ON\|OFF\)" | |
99 syn match tssclDirective "\*CLOSE" | |
100 syn match tssclDirective "\*CPU" | |
101 syn match tssclDirective "\*DEFINE" | |
102 syn match tssclDirective "\*ECHO" | |
103 syn match tssclConditional "\*ELSE" | |
104 syn match tssclConditional "\*END \+\(IF\|WHILE\)" | |
105 syn match tssclDirective "\*EXIT" | |
106 syn match tssclConditional "\*IF" | |
107 syn match tssclDirective "\*LIST" | |
108 syn match tssclDirective "\*OPEN" | |
109 syn match tssclDirective "\*PROMPT" | |
110 syn match tssclDirective "\*READ" | |
111 syn match tssclDirective "\*REWIND" | |
112 syn match tssclDirective "\*STOP" | |
113 syn match tssclDirective "\*STRCMP" | |
114 syn match tssclDirective "\*SYSTEM" | |
115 syn match tssclDirective "\*UNDEFINE" | |
116 syn match tssclConditional "\*WHILE" | |
117 syn match tssclDirective "\*WRITE" | |
118 | |
119 syn match tssclContChar "-$" | |
120 | |
121 " C library functoins | |
122 " Bessel functions (jn, yn) | |
123 " Error and complementary error fuctions (erf, erfc) | |
124 " Exponential functions (exp) | |
125 " Logrithm (log, log10) | |
126 " Power (pow) | |
127 " Square root (sqrt) | |
128 " Floor (floor) | |
129 " Ceiling (ceil) | |
130 " Floating point remainder (fmod) | |
131 " Floating point absolute value (fabs) | |
132 " Gamma (gamma) | |
133 " Euclidean distance function (hypot) | |
134 " Hperbolic functions (sinh, cosh, tanh) | |
135 " Trigometric functions in radians (sin, cos, tan, asin, acos, atan, atan2) | |
136 " Trigometric functions in degrees (sind, cosd, tand, asind, acosd, atand, | |
137 " atan2d) | |
138 " | |
139 " local varialbles: cl_arg1, cl_arg2, etc. (cl_arg is an array of arguments) | |
140 " cl_args is the number of arguments | |
141 " | |
142 " | |
143 " I/O: *PROMPT, *WRITE, *READ | |
144 " | |
145 " Conditional branching: | |
146 " IF, ELSE IF, END | |
147 " *IF value *IF I==10 | |
148 " *ELSE IF value *ELSE IF I<10 | |
149 " *ELSE *ELSE | |
150 " *ENDIF *ENDIF | |
151 " | |
152 " | |
153 " Iterative looping: | |
154 " WHILE | |
155 " *WHILE test | |
156 " ..... | |
157 " *END WHILE | |
158 " | |
159 " | |
160 " EXAMPLE: | |
161 " *DEFINE I = 1 | |
162 " *WHILE (I <= 10) | |
163 " *WRITE I = 'I' | |
164 " *DEFINE I = (I + 1) | |
165 " *END WHILE | |
166 " | |
167 | |
168 syn match tssclQualifier "/[^/ ]\+"hs=s+1 | |
169 syn match tssclSymbol "'\S\+'" | |
170 "syn match tssclSymbol2 " \S\+ " contained | |
171 | |
172 syn match tssclInteger "-\=\<[0-9]*\>" | |
173 syn match tssclFloat "-\=\<[0-9]*\.[0-9]*" | |
174 syn match tssclScientific "-\=\<[0-9]*\.[0-9]*E[-+]\=[0-9]\+\>" | |
175 | |
176 | |
177 | |
178 " Define the default highlighting | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
179 " Only when an item doesn't have highlighting yet |
7 | 180 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
181 hi def link tssclCommand Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
182 hi def link tssclKeyword Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
183 hi def link tssclEnd Macro |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
184 hi def link tssclUnits Special |
7 | 185 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
186 hi def link tssclComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
187 hi def link tssclDirective Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
188 hi def link tssclConditional Conditional |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
189 hi def link tssclContChar Macro |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
190 hi def link tssclQualifier Typedef |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
191 hi def link tssclSymbol Identifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
192 hi def link tssclSymbol2 Symbol |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
193 hi def link tssclString String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
194 hi def link tssclOper Operator |
7 | 195 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
196 hi def link tssclInteger Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
197 hi def link tssclFloat Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
198 hi def link tssclScientific Number |
7 | 199 |
200 | |
201 | |
202 let b:current_syntax = "tsscl" | |
203 | |
204 " vim: ts=8 sw=2 |