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