Debian Codegraph @

share/nagelfar/syntaxdb_modulefile.tcl

raw
1 #
2 # SYNTAXDB_MODULEFILE.tcl, Nagelfar syntax database to lint modulefiles
3 # Copyright (C) 2022-2025 Xavier Delaruelle
4 #
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 ##########################################################################
19
20 lappend ::knownGlobals {*}{
21 ModulesCurrentModulefile
22 ModuleTool
23 ModuleToolVersion
24 ModuleVariant
25 }
26
27 lappend ::knownCommands {*}{
28 add-property
29 always-load
30 append-path
31 chdir
32 complete
33 conflict
34 depends-on
35 depends-on-any
36 extensions
37 family
38 getenv
39 getvariant
40 haveDynamicMPATH
41 is-avail
42 is-loaded
43 is-saved
44 is-used
45 lsb-release
46 module
47 module-alias
48 module-forbid
49 module-help
50 module-hide
51 module-info
52 module-tag
53 module-version
54 module-virtual
55 module-warn
56 module-whatis
57 modulepath-label
58 prepend-path
59 prereq
60 prereq-all
61 prereq-any
62 provide
63 pushenv
64 remove-path
65 reportError
66 reportWarning
67 require-fullname
68 set-alias
69 set-function
70 setenv
71 source-sh
72 system
73 uname
74 uncomplete
75 unset-alias
76 unset-function
77 unsetenv
78 variant
79 versioncmp
80 x-resource
81 remove-property
82 module-log
83 module-trace
84 module-user
85 module-verbosity
86 }
87
88 # syntax
89 set ::syntax(add-property) 2
90 set ::syntax(always-load) {o* x x*}
91 set ::syntax(append-path) {o* x x x*}
92 set ::syntax(chdir) 1
93 set ::syntax(complete) 3
94 set ::syntax(conflict) {x x*}
95 set ::syntax(depends-on) {o* x x*}
96 set ::syntax(depends-on-any) {o* x x*}
97 set ::syntax(extensions) {x x*}
98 set ::syntax(family) 1
99 set ::syntax(getenv) {o? x x?}
100 set ::syntax(getvariant) {o? x x?}
101 set ::syntax(haveDynamicMPATH) 0
102 set ::syntax(is-avail) {x x*}
103 set ::syntax(is-loaded) x*
104 set ::syntax(is-saved) x*
105 set ::syntax(is-used) x*
106 set ::syntax(lsb-release) s
107 set {::syntax(lsb-release id)} 0
108 set {::syntax(lsb-release codename)} 0
109 set {::syntax(lsb-release release)} 0
110 # module accepts option at any position
111 set ::syntax(module) {s x*}
112 set {::syntax(module add)} {o* x* o*}
113 set {::syntax(module load)} {o* x* o*}
114 set {::syntax(module try-add)} {o* x* o*}
115 set {::syntax(module try-load)} {o* x* o*}
116 set {::syntax(module add-any)} {o* x* o*}
117 set {::syntax(module load-any)} {o* x* o*}
118 set {::syntax(module remove)} {o* x* o*}
119 set {::syntax(module rm)} {o* x* o*}
120 set {::syntax(module delete)} {o* x* o*}
121 set {::syntax(module unload)} {o* x* o*}
122 set {::syntax(module swap)} {o* x* o*}
123 set {::syntax(module switch)} {o* x* o*}
124 set {::syntax(module unuse)} {o* x* o*}
125 set {::syntax(module aliases)} 0
126 set {::syntax(module initclear)} 0
127 set {::syntax(module initlist)} 0
128 set {::syntax(module purge)} 0
129 set {::syntax(module reload)} 0
130 set {::syntax(module update)} 0
131 set {::syntax(module use)} x*
132 set {::syntax(module available)} x*
133 set {::syntax(module avail)} x*
134 set {::syntax(module show)} x*
135 set {::syntax(module display)} x*
136 set {::syntax(module initload)} x*
137 set {::syntax(module initadd)} x*
138 set {::syntax(module initprepend)} x*
139 set {::syntax(module initunload)} x*
140 set {::syntax(module initrm)} x*
141 set {::syntax(module initswap)} x*
142 set {::syntax(module initswitch)} x*
143 set {::syntax(module list)} x*
144 set {::syntax(module restore)} x*
145 set {::syntax(module save)} x*
146 set {::syntax(module savelist)} x*
147 set {::syntax(module saverm)} x*
148 set {::syntax(module disable)} x*
149 set {::syntax(module saveshow)} x*
150 set {::syntax(module describe)} x*
151 set {::syntax(module apropos)} x*
152 set {::syntax(module keyword)} x*
153 set {::syntax(module search)} x*
154 set {::syntax(module test)} x*
155 set {::syntax(module whatis)} x*
156 set ::syntax(module-alias) 2
157 # module-forbid accepts option at any position
158 set ::syntax(module-forbid) {p* x p* x* p*}
159 set ::syntax(module-help) 1
160 # module-hide accepts option at any position
161 set ::syntax(module-hide) {o* x o* x* o*}
162 set ::syntax(module-info) {s x?}
163 set {::syntax(module-info alias)} 1
164 set {::syntax(module-info command)} x?
165 set {::syntax(module-info loaded)} 1
166 set {::syntax(module-info mode)} x?
167 set {::syntax(module-info name)} 0
168 set {::syntax(module-info shell)} x?
169 set {::syntax(module-info shelltype)} x?
170 set {::syntax(module-info specified)} 0
171 set {::syntax(module-info symbols)} 1
172 set {::syntax(module-info tags)} x?
173 set {::syntax(module-info type)} 0
174 set {::syntax(module-info usergroups)} x?
175 set {::syntax(module-info username)} x?
176 set {::syntax(module-info version)} 1
177 # module-tag accepts option at any position
178 set ::syntax(module-tag) {p* x p* x p* x* p*}
179 set ::syntax(module-version) {x x x*}
180 set ::syntax(module-virtual) 2
181 # module-warn accepts option at any position
182 set ::syntax(module-warn) {p* x p* x* p*}
183 set ::syntax(module-whatis) 1
184 set ::syntax(modulepath-label) 2
185 set ::syntax(prepend-path) {o* x x x*}
186 set ::syntax(prereq) {o* x x*}
187 set ::syntax(prereq-all) {o* x x*}
188 set ::syntax(prereq-any) {o* x x*}
189 set ::syntax(provide) {x x*}
190 set ::syntax(pushenv) 2
191 set ::syntax(remove-path) {o* x x x* p? x*}
192 set ::syntax(reportError) 1
193 set ::syntax(reportWarning) 1
194 set ::syntax(require-fullname) 0
195 set ::syntax(set-alias) 2
196 set ::syntax(set-function) 2
197 # setenv accepts option at any position
198 set ::syntax(setenv) {o? x o? x o?}
199 set ::syntax(source-sh) {o* x x x*}
200 set ::syntax(system) {x x*}
201 set ::syntax(uname) s
202 set {::syntax(uname sysname)} 0
203 set {::syntax(uname nodename)} 0
204 set {::syntax(uname domain)} 0
205 set {::syntax(uname release)} 0
206 set {::syntax(uname version)} 0
207 set {::syntax(uname machine)} 0
208 set ::syntax(uncomplete) 1
209 set ::syntax(unset-alias) 1
210 set ::syntax(unset-function) 1
211 # unsetenv accepts option at any position
212 set ::syntax(unsetenv) {o* x o* x? o*}
213 set ::syntax(variant) {o* x x*}
214 set ::syntax(versioncmp) 2
215 set ::syntax(x-resource) 1
216 # not implemented commands
217 set ::syntax(remove-property) 2
218 set {::syntax(module-info flags)} 0
219 set {::syntax(module-info trace)} 0
220 set {::syntax(module-info tracepat)} 0
221 set {::syntax(module-info user)} x?
222 set ::syntax(module-log) 2
223 set ::syntax(module-trace) {x x*}
224 set ::syntax(module-user) 1
225 set ::syntax(module-verbosity) 1
226
227 # return
228 set ::return(is-avail) int
229 set ::return(is-loaded) int
230 set ::return(is-saved) int
231 set ::return(is-used) int
232 set ::return(system) int
233 set ::return(versioncmp) int
234 set {::return(module-info flags)} int
235
236 # subCmd
237 set ::subCmd(lsb-release) {id release codename}
238 set ::subCmd(module) {add load add-any load-any swap switch try-add try-load\
239 remove rm delete unload unuse use aliases available avail show display\
240 initadd initload initclear initlist initprepend initunload initrm\
241 initswap initswitch list purge reload restore save savelist saverm disable\
242 saveshow describe apropos keyword search test update whatis}
243 set ::subCmd(module-info) {alias command loaded mode name shell shelltype\
244 specified symbols tags type usergroups username version user trace\
245 tracepat flags}
246 set ::subCmd(uname) {sysname nodename domain release version machine}
247
248 # option
249 set ::option(always-load) {--optional --tag}
250 set {::option(always-load --tag)} 1
251 set ::option(append-path) {-d --delim --duplicates --ignore-refcount}
252 set {::option(append-path -d)} 1
253 set {::option(append-path --delim)} 1
254 set ::option(depends-on) {--optional --tag}
255 set {::option(depends-on --tag)} 1
256 set ::option(depends-on-any) {--optional --tag}
257 set {::option(depends-on-any --tag)} 1
258 set ::option(getenv) --return-value
259 set ::option(getvariant) --return-value
260 set {::option(module add)} {--tag --not-req}
261 set {::option(module add --tag)} 1
262 set {::option(module load)} {--tag --not-req}
263 set {::option(module load --tag)} 1
264 set {::option(module try-add)} {--tag --not-req}
265 set {::option(module try-add --tag)} 1
266 set {::option(module try-load)} {--tag --not-req}
267 set {::option(module try-load --tag)} 1
268 set {::option(module add-any)} {--tag --not-req}
269 set {::option(module add-any --tag)} 1
270 set {::option(module load-any)} {--tag --not-req}
271 set {::option(module load-any --tag)} 1
272 set {::option(module remove)} {--tag --not-req}
273 set {::option(module remove --tag)} 1
274 set {::option(module rm)} {--tag --not-req}
275 set {::option(module rm --tag)} 1
276 set {::option(module delete)} {--tag --not-req}
277 set {::option(module delete --tag)} 1
278 set {::option(module unload)} {--tag --not-req}
279 set {::option(module unload --tag)} 1
280 set {::option(module swap)} {--tag --not-req}
281 set {::option(module swap --tag)} 1
282 set {::option(module switch)} {--tag --not-req}
283 set {::option(module switch --tag)} 1
284 set {::option(module unuse)} {--remove-on-unload --noop-on-unload\
285 --append-on-unload --prepend-on-unload}
286 set ::option(module-forbid) {--user --group --not-user --not-group --after\
287 --before --message --nearly-message}
288 set {::option(module-forbid --user)} 1
289 set {::option(module-forbid --group)} 1
290 set {::option(module-forbid --not-user)} 1
291 set {::option(module-forbid --not-group)} 1
292 set {::option(module-forbid --after)} 1
293 set {::option(module-forbid --before)} 1
294 set ::option(module-hide) {--user --group --not-user --not-group --after\
295 --before --soft --hard --hidden-loaded}
296 set {::option(module-hide --user)} 1
297 set {::option(module-hide --group)} 1
298 set {::option(module-hide --not-user)} 1
299 set {::option(module-hide --not-group)} 1
300 set {::option(module-hide --after)} 1
301 set {::option(module-hide --before)} 1
302 set ::option(module-tag) {--user --group --not-user --not-group}
303 set {::option(module-tag --user)} 1
304 set {::option(module-tag --group)} 1
305 set {::option(module-tag --not-user)} 1
306 set {::option(module-tag --not-group)} 1
307 set ::option(module-warn) {--user --group --not-user --not-group --after\
308 --before --message}
309 set {::option(module-warn --user)} 1
310 set {::option(module-warn --group)} 1
311 set {::option(module-warn --not-user)} 1
312 set {::option(module-warn --not-group)} 1
313 set {::option(module-warn --after)} 1
314 set {::option(module-warn --before)} 1
315 set ::option(prepend-path) {-d --delim --duplicates --ignore-refcount}
316 set {::option(prepend-path -d)} 1
317 set {::option(prepend-path --delim)} 1
318 set ::option(prereq) {--optional --tag}
319 set {::option(prereq --tag)} 1
320 set ::option(prereq-all) {--optional --tag}
321 set {::option(prereq-all --tag)} 1
322 set ::option(prereq-any) {--optional --tag}
323 set {::option(prereq-any --tag)} 1
324 set ::option(remove-path) {-d --delim --glob --index --ignore-refcount\
325 --remove-on-unload --noop-on-unload --append-on-unload\
326 --prepend-on-unload}
327 set {::option(remove-path -d)} 1
328 set {::option(remove-path --delim)} 1
329 set ::option(setenv) --set-if-undef
330 set ::option(source-sh) --ignore
331 set {::option(source-sh --ignore)} 1
332 set ::option(unsetenv) {--noop-on-unload --unset-on-unload}
333 set ::option(variant) {--boolean --default}
334 set {::option(variant --default)} 1
335
336 # vim:set tabstop=3 shiftwidth=3 expandtab autoindent: