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

392 lines, 381 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 read = 18
256 echo = 19
257 printf = 20
258 mapfile = 21
259 readarray = 22
260 cd = 23
261 pushd = 24
262 popd = 25
263 dirs = 26
264 pwd = 27
265 source = 28
266 umask = 29
267 ulimit = 30
268 wait = 31
269 jobs = 32
270 fg = 33
271 bg = 34
272 shopt = 35
273 complete = 36
274 compgen = 37
275 compopt = 38
276 compadjust = 39
277 compexport = 40
278 getopts = 41
279 builtin = 42
280 command = 43
281 type = 44
282 hash = 45
283 help = 46
284 history = 47
285 alias = 48
286 unalias = 49
287 bind = 50
288 append = 51
289 write = 52
290 json = 53
291 json8 = 54
292 pp = 55
293 hay = 56
294 haynode = 57
295 module = 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 is_main = 72
310 cat = 73
311 ARRAY_SIZE = 74
312
313_builtin_str = {
314 1: 'builtin.colon',
315 2: 'builtin.dot',
316 3: 'builtin.exec_',
317 4: 'builtin.eval',
318 5: 'builtin.set',
319 6: 'builtin.shift',
320 7: 'builtin.times',
321 8: 'builtin.trap',
322 9: 'builtin.unset',
323 10: 'builtin.readonly',
324 11: 'builtin.local',
325 12: 'builtin.declare',
326 13: 'builtin.typeset',
327 14: 'builtin.export_',
328 15: 'builtin.true_',
329 16: 'builtin.false_',
330 17: 'builtin.try_',
331 18: 'builtin.read',
332 19: 'builtin.echo',
333 20: 'builtin.printf',
334 21: 'builtin.mapfile',
335 22: 'builtin.readarray',
336 23: 'builtin.cd',
337 24: 'builtin.pushd',
338 25: 'builtin.popd',
339 26: 'builtin.dirs',
340 27: 'builtin.pwd',
341 28: 'builtin.source',
342 29: 'builtin.umask',
343 30: 'builtin.ulimit',
344 31: 'builtin.wait',
345 32: 'builtin.jobs',
346 33: 'builtin.fg',
347 34: 'builtin.bg',
348 35: 'builtin.shopt',
349 36: 'builtin.complete',
350 37: 'builtin.compgen',
351 38: 'builtin.compopt',
352 39: 'builtin.compadjust',
353 40: 'builtin.compexport',
354 41: 'builtin.getopts',
355 42: 'builtin.builtin',
356 43: 'builtin.command',
357 44: 'builtin.type',
358 45: 'builtin.hash',
359 46: 'builtin.help',
360 47: 'builtin.history',
361 48: 'builtin.alias',
362 49: 'builtin.unalias',
363 50: 'builtin.bind',
364 51: 'builtin.append',
365 52: 'builtin.write',
366 53: 'builtin.json',
367 54: 'builtin.json8',
368 55: 'builtin.pp',
369 56: 'builtin.hay',
370 57: 'builtin.haynode',
371 58: 'builtin.module',
372 59: 'builtin.use',
373 60: 'builtin.error',
374 61: 'builtin.failed',
375 62: 'builtin.fork',
376 63: 'builtin.forkwait',
377 64: 'builtin.fopen',
378 65: 'builtin.shvar',
379 66: 'builtin.ctx',
380 67: 'builtin.runproc',
381 68: 'builtin.boolstatus',
382 69: 'builtin.test',
383 70: 'builtin.bracket',
384 71: 'builtin.push_registers',
385 72: 'builtin.is_main',
386 73: 'builtin.cat',
387}
388
389def builtin_str(val):
390 # type: (builtin_t) -> str
391 return _builtin_str[val]
392