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

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