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