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

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