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