OILS / _devbuild / gen / option_asdl.py View on Github | oilshell.org

408 lines, 397 significant
1from asdl import pybase
2
3option_t = int # type alias for integer
4
5class option_i(object):
6 errexit = 1
7 nounset = 2
8 pipefail = 3
9 inherit_errexit = 4
10 nullglob = 5
11 verbose_errexit = 6
12 noexec = 7
13 xtrace = 8
14 verbose = 9
15 noglob = 10
16 noclobber = 11
17 errtrace = 12
18 posix = 13
19 vi = 14
20 emacs = 15
21 interactive = 16
22 hashall = 17
23 lastpipe = 18
24 failglob = 19
25 extglob = 20
26 nocasematch = 21
27 eval_unsafe_arith = 22
28 ignore_flags_not_impl = 23
29 ignore_shopt_not_impl = 24
30 _allow_command_sub = 25
31 _allow_process_sub = 26
32 dynamic_scope = 27
33 redefine_const = 28
34 redefine_source = 29
35 _running_trap = 30
36 _running_hay = 31
37 _no_debug_trap = 32
38 _no_err_trap = 33
39 strict_parse_slice = 34
40 strict_argv = 35
41 strict_arith = 36
42 strict_array = 37
43 strict_control_flow = 38
44 strict_errexit = 39
45 strict_nameref = 40
46 strict_word_eval = 41
47 strict_tilde = 42
48 strict_glob = 43
49 parse_at = 44
50 parse_proc = 45
51 parse_func = 46
52 parse_brace = 47
53 parse_bracket = 48
54 parse_equals = 49
55 parse_paren = 50
56 parse_ysh_string = 51
57 parse_triple_quote = 52
58 simple_word_eval = 53
59 dashglob = 54
60 command_sub_errexit = 55
61 process_sub_fail = 56
62 xtrace_rich = 57
63 xtrace_details = 58
64 sigpipe_status_ok = 59
65 env_obj = 60
66 parse_at_all = 61
67 parse_backslash = 62
68 parse_backticks = 63
69 parse_dollar = 64
70 parse_ignored = 65
71 parse_sh_arith = 66
72 parse_dparen = 67
73 parse_dbracket = 68
74 parse_bare_word = 69
75 no_exported = 70
76 no_init_globals = 71
77 simple_echo = 72
78 simple_eval_builtin = 73
79 simple_test_builtin = 74
80 expand_aliases = 75
81 progcomp = 76
82 histappend = 77
83 hostcomplete = 78
84 cmdhist = 79
85 assoc_expand_once = 80
86 autocd = 81
87 cdable_vars = 82
88 cdspell = 83
89 checkhash = 84
90 checkjobs = 85
91 checkwinsize = 86
92 complete_fullquote = 87
93 direxpand = 88
94 dirspell = 89
95 dotglob = 90
96 execfail = 91
97 extdebug = 92
98 extquote = 93
99 force_fignore = 94
100 globasciiranges = 95
101 globstar = 96
102 gnu_errfmt = 97
103 histreedit = 98
104 histverify = 99
105 huponexit = 100
106 interactive_comments = 101
107 lithist = 102
108 localvar_inherit = 103
109 localvar_unset = 104
110 login_shell = 105
111 mailwarn = 106
112 no_empty_cmd_completion = 107
113 nocaseglob = 108
114 progcomp_alias = 109
115 promptvars = 110
116 restricted_shell = 111
117 shift_verbose = 112
118 sourcepath = 113
119 xpg_echo = 114
120 ARRAY_SIZE = 115
121
122_option_str = {
123 1: 'option.errexit',
124 2: 'option.nounset',
125 3: 'option.pipefail',
126 4: 'option.inherit_errexit',
127 5: 'option.nullglob',
128 6: 'option.verbose_errexit',
129 7: 'option.noexec',
130 8: 'option.xtrace',
131 9: 'option.verbose',
132 10: 'option.noglob',
133 11: 'option.noclobber',
134 12: 'option.errtrace',
135 13: 'option.posix',
136 14: 'option.vi',
137 15: 'option.emacs',
138 16: 'option.interactive',
139 17: 'option.hashall',
140 18: 'option.lastpipe',
141 19: 'option.failglob',
142 20: 'option.extglob',
143 21: 'option.nocasematch',
144 22: 'option.eval_unsafe_arith',
145 23: 'option.ignore_flags_not_impl',
146 24: 'option.ignore_shopt_not_impl',
147 25: 'option._allow_command_sub',
148 26: 'option._allow_process_sub',
149 27: 'option.dynamic_scope',
150 28: 'option.redefine_const',
151 29: 'option.redefine_source',
152 30: 'option._running_trap',
153 31: 'option._running_hay',
154 32: 'option._no_debug_trap',
155 33: 'option._no_err_trap',
156 34: 'option.strict_parse_slice',
157 35: 'option.strict_argv',
158 36: 'option.strict_arith',
159 37: 'option.strict_array',
160 38: 'option.strict_control_flow',
161 39: 'option.strict_errexit',
162 40: 'option.strict_nameref',
163 41: 'option.strict_word_eval',
164 42: 'option.strict_tilde',
165 43: 'option.strict_glob',
166 44: 'option.parse_at',
167 45: 'option.parse_proc',
168 46: 'option.parse_func',
169 47: 'option.parse_brace',
170 48: 'option.parse_bracket',
171 49: 'option.parse_equals',
172 50: 'option.parse_paren',
173 51: 'option.parse_ysh_string',
174 52: 'option.parse_triple_quote',
175 53: 'option.simple_word_eval',
176 54: 'option.dashglob',
177 55: 'option.command_sub_errexit',
178 56: 'option.process_sub_fail',
179 57: 'option.xtrace_rich',
180 58: 'option.xtrace_details',
181 59: 'option.sigpipe_status_ok',
182 60: 'option.env_obj',
183 61: 'option.parse_at_all',
184 62: 'option.parse_backslash',
185 63: 'option.parse_backticks',
186 64: 'option.parse_dollar',
187 65: 'option.parse_ignored',
188 66: 'option.parse_sh_arith',
189 67: 'option.parse_dparen',
190 68: 'option.parse_dbracket',
191 69: 'option.parse_bare_word',
192 70: 'option.no_exported',
193 71: 'option.no_init_globals',
194 72: 'option.simple_echo',
195 73: 'option.simple_eval_builtin',
196 74: 'option.simple_test_builtin',
197 75: 'option.expand_aliases',
198 76: 'option.progcomp',
199 77: 'option.histappend',
200 78: 'option.hostcomplete',
201 79: 'option.cmdhist',
202 80: 'option.assoc_expand_once',
203 81: 'option.autocd',
204 82: 'option.cdable_vars',
205 83: 'option.cdspell',
206 84: 'option.checkhash',
207 85: 'option.checkjobs',
208 86: 'option.checkwinsize',
209 87: 'option.complete_fullquote',
210 88: 'option.direxpand',
211 89: 'option.dirspell',
212 90: 'option.dotglob',
213 91: 'option.execfail',
214 92: 'option.extdebug',
215 93: 'option.extquote',
216 94: 'option.force_fignore',
217 95: 'option.globasciiranges',
218 96: 'option.globstar',
219 97: 'option.gnu_errfmt',
220 98: 'option.histreedit',
221 99: 'option.histverify',
222 100: 'option.huponexit',
223 101: 'option.interactive_comments',
224 102: 'option.lithist',
225 103: 'option.localvar_inherit',
226 104: 'option.localvar_unset',
227 105: 'option.login_shell',
228 106: 'option.mailwarn',
229 107: 'option.no_empty_cmd_completion',
230 108: 'option.nocaseglob',
231 109: 'option.progcomp_alias',
232 110: 'option.promptvars',
233 111: 'option.restricted_shell',
234 112: 'option.shift_verbose',
235 113: 'option.sourcepath',
236 114: 'option.xpg_echo',
237}
238
239def option_str(val):
240 # type: (option_t) -> str
241 return _option_str[val]
242
243builtin_t = int # type alias for integer
244
245class builtin_i(object):
246 colon = 1
247 dot = 2
248 exec_ = 3
249 eval = 4
250 set = 5
251 shift = 6
252 times = 7
253 trap = 8
254 unset = 9
255 readonly = 10
256 local = 11
257 declare = 12
258 typeset = 13
259 export_ = 14
260 extern_ = 15
261 true_ = 16
262 false_ = 17
263 try_ = 18
264 assert_ = 19
265 read = 20
266 echo = 21
267 printf = 22
268 mapfile = 23
269 readarray = 24
270 cd = 25
271 pushd = 26
272 popd = 27
273 dirs = 28
274 pwd = 29
275 source = 30
276 umask = 31
277 ulimit = 32
278 wait = 33
279 jobs = 34
280 fg = 35
281 bg = 36
282 shopt = 37
283 complete = 38
284 compgen = 39
285 compopt = 40
286 compadjust = 41
287 compexport = 42
288 getopts = 43
289 builtin = 44
290 command = 45
291 type = 46
292 hash = 47
293 help = 48
294 history = 49
295 alias = 50
296 unalias = 51
297 bind = 52
298 append = 53
299 write = 54
300 json = 55
301 json8 = 56
302 pp = 57
303 hay = 58
304 haynode = 59
305 use = 60
306 error = 61
307 failed = 62
308 fork = 63
309 forkwait = 64
310 redir = 65
311 fopen = 66
312 shvar = 67
313 ctx = 68
314 invoke = 69
315 runproc = 70
316 boolstatus = 71
317 test = 72
318 bracket = 73
319 push_registers = 74
320 source_guard = 75
321 is_main = 76
322 cat = 77
323 ARRAY_SIZE = 78
324
325_builtin_str = {
326 1: 'builtin.colon',
327 2: 'builtin.dot',
328 3: 'builtin.exec_',
329 4: 'builtin.eval',
330 5: 'builtin.set',
331 6: 'builtin.shift',
332 7: 'builtin.times',
333 8: 'builtin.trap',
334 9: 'builtin.unset',
335 10: 'builtin.readonly',
336 11: 'builtin.local',
337 12: 'builtin.declare',
338 13: 'builtin.typeset',
339 14: 'builtin.export_',
340 15: 'builtin.extern_',
341 16: 'builtin.true_',
342 17: 'builtin.false_',
343 18: 'builtin.try_',
344 19: 'builtin.assert_',
345 20: 'builtin.read',
346 21: 'builtin.echo',
347 22: 'builtin.printf',
348 23: 'builtin.mapfile',
349 24: 'builtin.readarray',
350 25: 'builtin.cd',
351 26: 'builtin.pushd',
352 27: 'builtin.popd',
353 28: 'builtin.dirs',
354 29: 'builtin.pwd',
355 30: 'builtin.source',
356 31: 'builtin.umask',
357 32: 'builtin.ulimit',
358 33: 'builtin.wait',
359 34: 'builtin.jobs',
360 35: 'builtin.fg',
361 36: 'builtin.bg',
362 37: 'builtin.shopt',
363 38: 'builtin.complete',
364 39: 'builtin.compgen',
365 40: 'builtin.compopt',
366 41: 'builtin.compadjust',
367 42: 'builtin.compexport',
368 43: 'builtin.getopts',
369 44: 'builtin.builtin',
370 45: 'builtin.command',
371 46: 'builtin.type',
372 47: 'builtin.hash',
373 48: 'builtin.help',
374 49: 'builtin.history',
375 50: 'builtin.alias',
376 51: 'builtin.unalias',
377 52: 'builtin.bind',
378 53: 'builtin.append',
379 54: 'builtin.write',
380 55: 'builtin.json',
381 56: 'builtin.json8',
382 57: 'builtin.pp',
383 58: 'builtin.hay',
384 59: 'builtin.haynode',
385 60: 'builtin.use',
386 61: 'builtin.error',
387 62: 'builtin.failed',
388 63: 'builtin.fork',
389 64: 'builtin.forkwait',
390 65: 'builtin.redir',
391 66: 'builtin.fopen',
392 67: 'builtin.shvar',
393 68: 'builtin.ctx',
394 69: 'builtin.invoke',
395 70: 'builtin.runproc',
396 71: 'builtin.boolstatus',
397 72: 'builtin.test',
398 73: 'builtin.bracket',
399 74: 'builtin.push_registers',
400 75: 'builtin.source_guard',
401 76: 'builtin.is_main',
402 77: 'builtin.cat',
403}
404
405def builtin_str(val):
406 # type: (builtin_t) -> str
407 return _builtin_str[val]
408