1 | #include "_gen/frontend/consts.h"
|
2 |
|
3 | using id_kind_asdl::Id;
|
4 | using id_kind_asdl::Kind;
|
5 | using types_asdl::redir_arg_type_e;
|
6 | using types_asdl::bool_arg_type_e;
|
7 | using option_asdl::builtin_t;
|
8 |
|
9 | namespace consts {
|
10 |
|
11 | int NO_INDEX = 0; // duplicated from frontend/consts.py
|
12 |
|
13 | GLOBAL_STR(gVersion, "0.22.0");
|
14 |
|
15 | GLOBAL_LIST(STRICT_ALL, int, 9, {29 COMMA 30 COMMA 31 COMMA 32 COMMA 33 COMMA 37 COMMA 34 COMMA 36 COMMA 35});
|
16 | GLOBAL_LIST(YSH_UPGRADE, int, 23, {49 COMMA 48 COMMA 1 COMMA 4 COMMA 2 COMMA 5 COMMA 38 COMMA 41 COMMA 42 COMMA 43 COMMA 40 COMMA 44 COMMA 39 COMMA 46 COMMA 45 COMMA 3 COMMA 50 COMMA 54 COMMA 53 COMMA 47 COMMA 6 COMMA 52 COMMA 51});
|
17 | GLOBAL_LIST(YSH_ALL, int, 45, {49 COMMA 48 COMMA 1 COMMA 67 COMMA 4 COMMA 2 COMMA 5 COMMA 38 COMMA 55 COMMA 56 COMMA 57 COMMA 63 COMMA 41 COMMA 42 COMMA 62 COMMA 58 COMMA 61 COMMA 43 COMMA 40 COMMA 59 COMMA 44 COMMA 39 COMMA 60 COMMA 46 COMMA 45 COMMA 3 COMMA 50 COMMA 54 COMMA 53 COMMA 64 COMMA 65 COMMA 66 COMMA 47 COMMA 29 COMMA 30 COMMA 31 COMMA 32 COMMA 33 COMMA 37 COMMA 34 COMMA 36 COMMA 35 COMMA 6 COMMA 52 COMMA 51});
|
18 | GLOBAL_LIST(DEFAULT_TRUE, int, 16, {21 COMMA 22 COMMA 48 COMMA 23 COMMA 67 COMMA 16 COMMA 56 COMMA 57 COMMA 63 COMMA 62 COMMA 58 COMMA 61 COMMA 59 COMMA 60 COMMA 54 COMMA 52});
|
19 | GLOBAL_LIST(PARSE_OPTION_NUMS, int, 19, {67 COMMA 38 COMMA 55 COMMA 56 COMMA 57 COMMA 63 COMMA 41 COMMA 42 COMMA 62 COMMA 58 COMMA 61 COMMA 43 COMMA 40 COMMA 59 COMMA 44 COMMA 39 COMMA 60 COMMA 46 COMMA 45});
|
20 | GLOBAL_LIST(SHOPT_OPTION_NUMS, int, 94, {21 COMMA 22 COMMA 27 COMMA 28 COMMA 26 COMMA 25 COMMA 73 COMMA 74 COMMA 75 COMMA 76 COMMA 77 COMMA 78 COMMA 79 COMMA 72 COMMA 49 COMMA 80 COMMA 48 COMMA 81 COMMA 82 COMMA 83 COMMA 23 COMMA 20 COMMA 84 COMMA 67 COMMA 85 COMMA 18 COMMA 86 COMMA 17 COMMA 87 COMMA 88 COMMA 89 COMMA 90 COMMA 70 COMMA 91 COMMA 92 COMMA 71 COMMA 93 COMMA 4 COMMA 94 COMMA 68 COMMA 95 COMMA 96 COMMA 97 COMMA 98 COMMA 99 COMMA 100 COMMA 101 COMMA 19 COMMA 5 COMMA 38 COMMA 55 COMMA 56 COMMA 57 COMMA 63 COMMA 41 COMMA 42 COMMA 62 COMMA 58 COMMA 61 COMMA 43 COMMA 40 COMMA 59 COMMA 44 COMMA 39 COMMA 60 COMMA 46 COMMA 45 COMMA 50 COMMA 69 COMMA 102 COMMA 103 COMMA 24 COMMA 54 COMMA 104 COMMA 105 COMMA 53 COMMA 64 COMMA 65 COMMA 66 COMMA 47 COMMA 106 COMMA 29 COMMA 30 COMMA 31 COMMA 32 COMMA 33 COMMA 37 COMMA 34 COMMA 36 COMMA 35 COMMA 6 COMMA 107 COMMA 52 COMMA 51});
|
21 | GLOBAL_LIST(SET_OPTION_NUMS, int, 12, {14 COMMA 1 COMMA 16 COMMA 11 COMMA 7 COMMA 10 COMMA 2 COMMA 3 COMMA 12 COMMA 9 COMMA 13 COMMA 8});
|
22 | GLOBAL_LIST(VISIBLE_SHOPT_NUMS, int, 54, {21 COMMA 22 COMMA 27 COMMA 28 COMMA 26 COMMA 25 COMMA 49 COMMA 48 COMMA 23 COMMA 20 COMMA 67 COMMA 18 COMMA 17 COMMA 4 COMMA 19 COMMA 5 COMMA 38 COMMA 55 COMMA 56 COMMA 57 COMMA 63 COMMA 41 COMMA 42 COMMA 62 COMMA 58 COMMA 61 COMMA 43 COMMA 40 COMMA 59 COMMA 44 COMMA 39 COMMA 60 COMMA 46 COMMA 45 COMMA 50 COMMA 24 COMMA 54 COMMA 53 COMMA 64 COMMA 65 COMMA 66 COMMA 47 COMMA 29 COMMA 30 COMMA 31 COMMA 32 COMMA 33 COMMA 37 COMMA 34 COMMA 36 COMMA 35 COMMA 6 COMMA 52 COMMA 51});
|
23 |
|
24 | int RedirDefaultFd(id_kind_asdl::Id_t id) {
|
25 | // relies on "switch lowering"
|
26 | switch (id) {
|
27 |
|
28 | case Id::Redir_Less: return 0;
|
29 | case Id::Redir_Great: return 1;
|
30 | case Id::Redir_DLess: return 0;
|
31 | case Id::Redir_TLess: return 0;
|
32 | case Id::Redir_DGreat: return 1;
|
33 | case Id::Redir_GreatAnd: return 1;
|
34 | case Id::Redir_LessAnd: return 0;
|
35 | case Id::Redir_DLessDash: return 0;
|
36 | case Id::Redir_LessGreat: return 0;
|
37 | case Id::Redir_Clobber: return 1;
|
38 | case Id::Redir_AndGreat: return 1;
|
39 | case Id::Redir_AndDGreat: return 1;
|
40 | }
|
41 | FAIL(kShouldNotGetHere);
|
42 | }
|
43 |
|
44 | types_asdl::redir_arg_type_t RedirArgType(id_kind_asdl::Id_t id) {
|
45 | // relies on "switch lowering"
|
46 | switch (id) {
|
47 |
|
48 | case Id::Redir_Less: return redir_arg_type_e::Path;
|
49 | case Id::Redir_Great: return redir_arg_type_e::Path;
|
50 | case Id::Redir_TLess: return redir_arg_type_e::Here;
|
51 | case Id::Redir_DGreat: return redir_arg_type_e::Path;
|
52 | case Id::Redir_GreatAnd: return redir_arg_type_e::Desc;
|
53 | case Id::Redir_LessAnd: return redir_arg_type_e::Desc;
|
54 | case Id::Redir_LessGreat: return redir_arg_type_e::Path;
|
55 | case Id::Redir_Clobber: return redir_arg_type_e::Path;
|
56 | case Id::Redir_AndGreat: return redir_arg_type_e::Path;
|
57 | case Id::Redir_AndDGreat: return redir_arg_type_e::Path;
|
58 | }
|
59 | FAIL(kShouldNotGetHere);
|
60 | }
|
61 |
|
62 | types_asdl::bool_arg_type_t BoolArgType(id_kind_asdl::Id_t id) {
|
63 | // relies on "switch lowering"
|
64 | switch (id) {
|
65 |
|
66 | case Id::Op_DAmp: return bool_arg_type_e::Undefined;
|
67 | case Id::Op_DPipe: return bool_arg_type_e::Undefined;
|
68 | case Id::Op_Less: return bool_arg_type_e::Str;
|
69 | case Id::Op_Great: return bool_arg_type_e::Str;
|
70 | case Id::KW_Bang: return bool_arg_type_e::Undefined;
|
71 | case Id::BoolUnary_z: return bool_arg_type_e::Str;
|
72 | case Id::BoolUnary_n: return bool_arg_type_e::Str;
|
73 | case Id::BoolUnary_o: return bool_arg_type_e::Other;
|
74 | case Id::BoolUnary_t: return bool_arg_type_e::Other;
|
75 | case Id::BoolUnary_v: return bool_arg_type_e::Other;
|
76 | case Id::BoolUnary_R: return bool_arg_type_e::Other;
|
77 | case Id::BoolUnary_a: return bool_arg_type_e::Path;
|
78 | case Id::BoolUnary_b: return bool_arg_type_e::Path;
|
79 | case Id::BoolUnary_c: return bool_arg_type_e::Path;
|
80 | case Id::BoolUnary_d: return bool_arg_type_e::Path;
|
81 | case Id::BoolUnary_e: return bool_arg_type_e::Path;
|
82 | case Id::BoolUnary_f: return bool_arg_type_e::Path;
|
83 | case Id::BoolUnary_g: return bool_arg_type_e::Path;
|
84 | case Id::BoolUnary_h: return bool_arg_type_e::Path;
|
85 | case Id::BoolUnary_k: return bool_arg_type_e::Path;
|
86 | case Id::BoolUnary_L: return bool_arg_type_e::Path;
|
87 | case Id::BoolUnary_p: return bool_arg_type_e::Path;
|
88 | case Id::BoolUnary_r: return bool_arg_type_e::Path;
|
89 | case Id::BoolUnary_s: return bool_arg_type_e::Path;
|
90 | case Id::BoolUnary_S: return bool_arg_type_e::Path;
|
91 | case Id::BoolUnary_u: return bool_arg_type_e::Path;
|
92 | case Id::BoolUnary_w: return bool_arg_type_e::Path;
|
93 | case Id::BoolUnary_x: return bool_arg_type_e::Path;
|
94 | case Id::BoolUnary_O: return bool_arg_type_e::Path;
|
95 | case Id::BoolUnary_G: return bool_arg_type_e::Path;
|
96 | case Id::BoolUnary_N: return bool_arg_type_e::Path;
|
97 | case Id::BoolBinary_GlobEqual: return bool_arg_type_e::Str;
|
98 | case Id::BoolBinary_GlobDEqual: return bool_arg_type_e::Str;
|
99 | case Id::BoolBinary_GlobNEqual: return bool_arg_type_e::Str;
|
100 | case Id::BoolBinary_EqualTilde: return bool_arg_type_e::Str;
|
101 | case Id::BoolBinary_ef: return bool_arg_type_e::Path;
|
102 | case Id::BoolBinary_nt: return bool_arg_type_e::Path;
|
103 | case Id::BoolBinary_ot: return bool_arg_type_e::Path;
|
104 | case Id::BoolBinary_eq: return bool_arg_type_e::Int;
|
105 | case Id::BoolBinary_ne: return bool_arg_type_e::Int;
|
106 | case Id::BoolBinary_gt: return bool_arg_type_e::Int;
|
107 | case Id::BoolBinary_ge: return bool_arg_type_e::Int;
|
108 | case Id::BoolBinary_lt: return bool_arg_type_e::Int;
|
109 | case Id::BoolBinary_le: return bool_arg_type_e::Int;
|
110 | case Id::BoolBinary_Equal: return bool_arg_type_e::Str;
|
111 | case Id::BoolBinary_DEqual: return bool_arg_type_e::Str;
|
112 | case Id::BoolBinary_NEqual: return bool_arg_type_e::Str;
|
113 | }
|
114 | FAIL(kShouldNotGetHere);
|
115 | }
|
116 |
|
117 | Kind GetKind(id_kind_asdl::Id_t id) {
|
118 | // relies on "switch lowering"
|
119 | switch (id) {
|
120 |
|
121 | case Id::Word_Compound: return Kind::Word;
|
122 | case Id::Arith_Semi: return Kind::Arith;
|
123 | case Id::Arith_Comma: return Kind::Arith;
|
124 | case Id::Arith_Plus: return Kind::Arith;
|
125 | case Id::Arith_Minus: return Kind::Arith;
|
126 | case Id::Arith_Star: return Kind::Arith;
|
127 | case Id::Arith_Slash: return Kind::Arith;
|
128 | case Id::Arith_Percent: return Kind::Arith;
|
129 | case Id::Arith_DPlus: return Kind::Arith;
|
130 | case Id::Arith_DMinus: return Kind::Arith;
|
131 | case Id::Arith_DStar: return Kind::Arith;
|
132 | case Id::Arith_LParen: return Kind::Arith;
|
133 | case Id::Arith_RParen: return Kind::Arith;
|
134 | case Id::Arith_LBracket: return Kind::Arith;
|
135 | case Id::Arith_RBracket: return Kind::Arith;
|
136 | case Id::Arith_RBrace: return Kind::Arith;
|
137 | case Id::Arith_QMark: return Kind::Arith;
|
138 | case Id::Arith_Colon: return Kind::Arith;
|
139 | case Id::Arith_LessEqual: return Kind::Arith;
|
140 | case Id::Arith_Less: return Kind::Arith;
|
141 | case Id::Arith_GreatEqual: return Kind::Arith;
|
142 | case Id::Arith_Great: return Kind::Arith;
|
143 | case Id::Arith_DEqual: return Kind::Arith;
|
144 | case Id::Arith_NEqual: return Kind::Arith;
|
145 | case Id::Arith_DAmp: return Kind::Arith;
|
146 | case Id::Arith_DPipe: return Kind::Arith;
|
147 | case Id::Arith_Bang: return Kind::Arith;
|
148 | case Id::Arith_DGreat: return Kind::Arith;
|
149 | case Id::Arith_DLess: return Kind::Arith;
|
150 | case Id::Arith_Amp: return Kind::Arith;
|
151 | case Id::Arith_Pipe: return Kind::Arith;
|
152 | case Id::Arith_Caret: return Kind::Arith;
|
153 | case Id::Arith_Tilde: return Kind::Arith;
|
154 | case Id::Arith_Equal: return Kind::Arith;
|
155 | case Id::Arith_PlusEqual: return Kind::Arith;
|
156 | case Id::Arith_MinusEqual: return Kind::Arith;
|
157 | case Id::Arith_StarEqual: return Kind::Arith;
|
158 | case Id::Arith_SlashEqual: return Kind::Arith;
|
159 | case Id::Arith_PercentEqual: return Kind::Arith;
|
160 | case Id::Arith_DGreatEqual: return Kind::Arith;
|
161 | case Id::Arith_DLessEqual: return Kind::Arith;
|
162 | case Id::Arith_AmpEqual: return Kind::Arith;
|
163 | case Id::Arith_CaretEqual: return Kind::Arith;
|
164 | case Id::Arith_PipeEqual: return Kind::Arith;
|
165 | case Id::Eof_Real: return Kind::Eof;
|
166 | case Id::Eof_RParen: return Kind::Eof;
|
167 | case Id::Eof_Backtick: return Kind::Eof;
|
168 | case Id::Undefined_Tok: return Kind::Undefined;
|
169 | case Id::Unknown_Tok: return Kind::Unknown;
|
170 | case Id::Unknown_Backslash: return Kind::Unknown;
|
171 | case Id::Unknown_DEqual: return Kind::Unknown;
|
172 | case Id::Eol_Tok: return Kind::Eol;
|
173 | case Id::Ignored_LineCont: return Kind::Ignored;
|
174 | case Id::Ignored_Space: return Kind::Ignored;
|
175 | case Id::Ignored_Comment: return Kind::Ignored;
|
176 | case Id::Ignored_Newline: return Kind::Ignored;
|
177 | case Id::WS_Space: return Kind::WS;
|
178 | case Id::Lit_Chars: return Kind::Lit;
|
179 | case Id::Lit_CharsWithoutPrefix: return Kind::Lit;
|
180 | case Id::Lit_VarLike: return Kind::Lit;
|
181 | case Id::Lit_ArrayLhsOpen: return Kind::Lit;
|
182 | case Id::Lit_ArrayLhsClose: return Kind::Lit;
|
183 | case Id::Lit_Splice: return Kind::Lit;
|
184 | case Id::Lit_AtLBracket: return Kind::Lit;
|
185 | case Id::Lit_AtLBraceDot: return Kind::Lit;
|
186 | case Id::Lit_Other: return Kind::Lit;
|
187 | case Id::Lit_EscapedChar: return Kind::Lit;
|
188 | case Id::Lit_LBracket: return Kind::Lit;
|
189 | case Id::Lit_RBracket: return Kind::Lit;
|
190 | case Id::Lit_Star: return Kind::Lit;
|
191 | case Id::Lit_QMark: return Kind::Lit;
|
192 | case Id::Lit_LBrace: return Kind::Lit;
|
193 | case Id::Lit_RBrace: return Kind::Lit;
|
194 | case Id::Lit_Comma: return Kind::Lit;
|
195 | case Id::Lit_Equals: return Kind::Lit;
|
196 | case Id::Lit_Dollar: return Kind::Lit;
|
197 | case Id::Lit_DRightBracket: return Kind::Lit;
|
198 | case Id::Lit_Tilde: return Kind::Lit;
|
199 | case Id::Lit_Pound: return Kind::Lit;
|
200 | case Id::Lit_TPound: return Kind::Lit;
|
201 | case Id::Lit_TDot: return Kind::Lit;
|
202 | case Id::Lit_Slash: return Kind::Lit;
|
203 | case Id::Lit_Percent: return Kind::Lit;
|
204 | case Id::Lit_Colon: return Kind::Lit;
|
205 | case Id::Lit_Digits: return Kind::Lit;
|
206 | case Id::Lit_At: return Kind::Lit;
|
207 | case Id::Lit_ArithVarLike: return Kind::Lit;
|
208 | case Id::Lit_BadBackslash: return Kind::Lit;
|
209 | case Id::Lit_CompDummy: return Kind::Lit;
|
210 | case Id::Backtick_Right: return Kind::Backtick;
|
211 | case Id::Backtick_Quoted: return Kind::Backtick;
|
212 | case Id::Backtick_DoubleQuote: return Kind::Backtick;
|
213 | case Id::Backtick_Other: return Kind::Backtick;
|
214 | case Id::History_Op: return Kind::History;
|
215 | case Id::History_Num: return Kind::History;
|
216 | case Id::History_Search: return Kind::History;
|
217 | case Id::History_Other: return Kind::History;
|
218 | case Id::Op_Newline: return Kind::Op;
|
219 | case Id::Op_Amp: return Kind::Op;
|
220 | case Id::Op_Pipe: return Kind::Op;
|
221 | case Id::Op_PipeAmp: return Kind::Op;
|
222 | case Id::Op_DAmp: return Kind::Op;
|
223 | case Id::Op_DPipe: return Kind::Op;
|
224 | case Id::Op_Semi: return Kind::Op;
|
225 | case Id::Op_DSemi: return Kind::Op;
|
226 | case Id::Op_SemiAmp: return Kind::Op;
|
227 | case Id::Op_DSemiAmp: return Kind::Op;
|
228 | case Id::Op_LParen: return Kind::Op;
|
229 | case Id::Op_RParen: return Kind::Op;
|
230 | case Id::Op_DLeftParen: return Kind::Op;
|
231 | case Id::Op_DRightParen: return Kind::Op;
|
232 | case Id::Op_Less: return Kind::Op;
|
233 | case Id::Op_Great: return Kind::Op;
|
234 | case Id::Op_Bang: return Kind::Op;
|
235 | case Id::Op_LBracket: return Kind::Op;
|
236 | case Id::Op_RBracket: return Kind::Op;
|
237 | case Id::Op_LBrace: return Kind::Op;
|
238 | case Id::Op_RBrace: return Kind::Op;
|
239 | case Id::Expr_Reserved: return Kind::Expr;
|
240 | case Id::Expr_Symbol: return Kind::Expr;
|
241 | case Id::Expr_Name: return Kind::Expr;
|
242 | case Id::Expr_DecInt: return Kind::Expr;
|
243 | case Id::Expr_BinInt: return Kind::Expr;
|
244 | case Id::Expr_OctInt: return Kind::Expr;
|
245 | case Id::Expr_HexInt: return Kind::Expr;
|
246 | case Id::Expr_Float: return Kind::Expr;
|
247 | case Id::Expr_Bang: return Kind::Expr;
|
248 | case Id::Expr_Dot: return Kind::Expr;
|
249 | case Id::Expr_DDot: return Kind::Expr;
|
250 | case Id::Expr_Colon: return Kind::Expr;
|
251 | case Id::Expr_RArrow: return Kind::Expr;
|
252 | case Id::Expr_RDArrow: return Kind::Expr;
|
253 | case Id::Expr_DSlash: return Kind::Expr;
|
254 | case Id::Expr_TEqual: return Kind::Expr;
|
255 | case Id::Expr_NotDEqual: return Kind::Expr;
|
256 | case Id::Expr_TildeDEqual: return Kind::Expr;
|
257 | case Id::Expr_At: return Kind::Expr;
|
258 | case Id::Expr_DoubleAt: return Kind::Expr;
|
259 | case Id::Expr_Ellipsis: return Kind::Expr;
|
260 | case Id::Expr_Dollar: return Kind::Expr;
|
261 | case Id::Expr_NotTilde: return Kind::Expr;
|
262 | case Id::Expr_DTilde: return Kind::Expr;
|
263 | case Id::Expr_NotDTilde: return Kind::Expr;
|
264 | case Id::Expr_DStarEqual: return Kind::Expr;
|
265 | case Id::Expr_DSlashEqual: return Kind::Expr;
|
266 | case Id::Expr_CastedDummy: return Kind::Expr;
|
267 | case Id::Expr_Null: return Kind::Expr;
|
268 | case Id::Expr_True: return Kind::Expr;
|
269 | case Id::Expr_False: return Kind::Expr;
|
270 | case Id::Expr_And: return Kind::Expr;
|
271 | case Id::Expr_Or: return Kind::Expr;
|
272 | case Id::Expr_Not: return Kind::Expr;
|
273 | case Id::Expr_For: return Kind::Expr;
|
274 | case Id::Expr_Is: return Kind::Expr;
|
275 | case Id::Expr_In: return Kind::Expr;
|
276 | case Id::Expr_If: return Kind::Expr;
|
277 | case Id::Expr_Else: return Kind::Expr;
|
278 | case Id::Expr_Func: return Kind::Expr;
|
279 | case Id::Expr_Capture: return Kind::Expr;
|
280 | case Id::Expr_As: return Kind::Expr;
|
281 | case Id::Char_OneChar: return Kind::Char;
|
282 | case Id::Char_Stop: return Kind::Char;
|
283 | case Id::Char_Hex: return Kind::Char;
|
284 | case Id::Char_YHex: return Kind::Char;
|
285 | case Id::Char_Octal3: return Kind::Char;
|
286 | case Id::Char_Octal4: return Kind::Char;
|
287 | case Id::Char_Unicode4: return Kind::Char;
|
288 | case Id::Char_SurrogatePair: return Kind::Char;
|
289 | case Id::Char_Unicode8: return Kind::Char;
|
290 | case Id::Char_UBraced: return Kind::Char;
|
291 | case Id::Char_Pound: return Kind::Char;
|
292 | case Id::Char_AsciiControl: return Kind::Char;
|
293 | case Id::BashRegex_LParen: return Kind::BashRegex;
|
294 | case Id::BashRegex_AllowedInParens: return Kind::BashRegex;
|
295 | case Id::Eggex_Start: return Kind::Eggex;
|
296 | case Id::Eggex_End: return Kind::Eggex;
|
297 | case Id::Eggex_Dot: return Kind::Eggex;
|
298 | case Id::Redir_Less: return Kind::Redir;
|
299 | case Id::Redir_Great: return Kind::Redir;
|
300 | case Id::Redir_DLess: return Kind::Redir;
|
301 | case Id::Redir_TLess: return Kind::Redir;
|
302 | case Id::Redir_DGreat: return Kind::Redir;
|
303 | case Id::Redir_GreatAnd: return Kind::Redir;
|
304 | case Id::Redir_LessAnd: return Kind::Redir;
|
305 | case Id::Redir_DLessDash: return Kind::Redir;
|
306 | case Id::Redir_LessGreat: return Kind::Redir;
|
307 | case Id::Redir_Clobber: return Kind::Redir;
|
308 | case Id::Redir_AndGreat: return Kind::Redir;
|
309 | case Id::Redir_AndDGreat: return Kind::Redir;
|
310 | case Id::Left_DoubleQuote: return Kind::Left;
|
311 | case Id::Left_JDoubleQuote: return Kind::Left;
|
312 | case Id::Left_SingleQuote: return Kind::Left;
|
313 | case Id::Left_DollarSingleQuote: return Kind::Left;
|
314 | case Id::Left_RSingleQuote: return Kind::Left;
|
315 | case Id::Left_USingleQuote: return Kind::Left;
|
316 | case Id::Left_BSingleQuote: return Kind::Left;
|
317 | case Id::Left_TDoubleQuote: return Kind::Left;
|
318 | case Id::Left_DollarTDoubleQuote: return Kind::Left;
|
319 | case Id::Left_TSingleQuote: return Kind::Left;
|
320 | case Id::Left_RTSingleQuote: return Kind::Left;
|
321 | case Id::Left_UTSingleQuote: return Kind::Left;
|
322 | case Id::Left_BTSingleQuote: return Kind::Left;
|
323 | case Id::Left_Backtick: return Kind::Left;
|
324 | case Id::Left_DollarParen: return Kind::Left;
|
325 | case Id::Left_DollarBrace: return Kind::Left;
|
326 | case Id::Left_DollarBraceZsh: return Kind::Left;
|
327 | case Id::Left_DollarDParen: return Kind::Left;
|
328 | case Id::Left_DollarBracket: return Kind::Left;
|
329 | case Id::Left_DollarDoubleQuote: return Kind::Left;
|
330 | case Id::Left_ProcSubIn: return Kind::Left;
|
331 | case Id::Left_ProcSubOut: return Kind::Left;
|
332 | case Id::Left_AtParen: return Kind::Left;
|
333 | case Id::Left_CaretParen: return Kind::Left;
|
334 | case Id::Left_CaretBracket: return Kind::Left;
|
335 | case Id::Left_CaretBrace: return Kind::Left;
|
336 | case Id::Left_CaretDoubleQuote: return Kind::Left;
|
337 | case Id::Left_ColonPipe: return Kind::Left;
|
338 | case Id::Left_PercentParen: return Kind::Left;
|
339 | case Id::Right_DoubleQuote: return Kind::Right;
|
340 | case Id::Right_SingleQuote: return Kind::Right;
|
341 | case Id::Right_Backtick: return Kind::Right;
|
342 | case Id::Right_DollarBrace: return Kind::Right;
|
343 | case Id::Right_DollarDParen: return Kind::Right;
|
344 | case Id::Right_DollarDoubleQuote: return Kind::Right;
|
345 | case Id::Right_DollarSingleQuote: return Kind::Right;
|
346 | case Id::Right_Subshell: return Kind::Right;
|
347 | case Id::Right_ShFunction: return Kind::Right;
|
348 | case Id::Right_CasePat: return Kind::Right;
|
349 | case Id::Right_ShArrayLiteral: return Kind::Right;
|
350 | case Id::Right_ExtGlob: return Kind::Right;
|
351 | case Id::Right_BashRegexGroup: return Kind::Right;
|
352 | case Id::Right_BlockLiteral: return Kind::Right;
|
353 | case Id::ExtGlob_Comma: return Kind::ExtGlob;
|
354 | case Id::ExtGlob_At: return Kind::ExtGlob;
|
355 | case Id::ExtGlob_Star: return Kind::ExtGlob;
|
356 | case Id::ExtGlob_Plus: return Kind::ExtGlob;
|
357 | case Id::ExtGlob_QMark: return Kind::ExtGlob;
|
358 | case Id::ExtGlob_Bang: return Kind::ExtGlob;
|
359 | case Id::VSub_DollarName: return Kind::VSub;
|
360 | case Id::VSub_Name: return Kind::VSub;
|
361 | case Id::VSub_Number: return Kind::VSub;
|
362 | case Id::VSub_Bang: return Kind::VSub;
|
363 | case Id::VSub_At: return Kind::VSub;
|
364 | case Id::VSub_Pound: return Kind::VSub;
|
365 | case Id::VSub_Dollar: return Kind::VSub;
|
366 | case Id::VSub_Star: return Kind::VSub;
|
367 | case Id::VSub_Hyphen: return Kind::VSub;
|
368 | case Id::VSub_QMark: return Kind::VSub;
|
369 | case Id::VSub_Dot: return Kind::VSub;
|
370 | case Id::VTest_ColonHyphen: return Kind::VTest;
|
371 | case Id::VTest_Hyphen: return Kind::VTest;
|
372 | case Id::VTest_ColonEquals: return Kind::VTest;
|
373 | case Id::VTest_Equals: return Kind::VTest;
|
374 | case Id::VTest_ColonQMark: return Kind::VTest;
|
375 | case Id::VTest_QMark: return Kind::VTest;
|
376 | case Id::VTest_ColonPlus: return Kind::VTest;
|
377 | case Id::VTest_Plus: return Kind::VTest;
|
378 | case Id::VOp0_Q: return Kind::VOp0;
|
379 | case Id::VOp0_E: return Kind::VOp0;
|
380 | case Id::VOp0_P: return Kind::VOp0;
|
381 | case Id::VOp0_A: return Kind::VOp0;
|
382 | case Id::VOp0_a: return Kind::VOp0;
|
383 | case Id::VOp1_Percent: return Kind::VOp1;
|
384 | case Id::VOp1_DPercent: return Kind::VOp1;
|
385 | case Id::VOp1_Pound: return Kind::VOp1;
|
386 | case Id::VOp1_DPound: return Kind::VOp1;
|
387 | case Id::VOp1_Caret: return Kind::VOp1;
|
388 | case Id::VOp1_DCaret: return Kind::VOp1;
|
389 | case Id::VOp1_Comma: return Kind::VOp1;
|
390 | case Id::VOp1_DComma: return Kind::VOp1;
|
391 | case Id::VOpYsh_Pipe: return Kind::VOpYsh;
|
392 | case Id::VOpYsh_Space: return Kind::VOpYsh;
|
393 | case Id::VOp2_Slash: return Kind::VOp2;
|
394 | case Id::VOp2_Colon: return Kind::VOp2;
|
395 | case Id::VOp2_LBracket: return Kind::VOp2;
|
396 | case Id::VOp2_RBracket: return Kind::VOp2;
|
397 | case Id::VOp3_At: return Kind::VOp3;
|
398 | case Id::VOp3_Star: return Kind::VOp3;
|
399 | case Id::Node_PostDPlus: return Kind::Node;
|
400 | case Id::Node_PostDMinus: return Kind::Node;
|
401 | case Id::Node_UnaryPlus: return Kind::Node;
|
402 | case Id::Node_UnaryMinus: return Kind::Node;
|
403 | case Id::Node_NotIn: return Kind::Node;
|
404 | case Id::Node_IsNot: return Kind::Node;
|
405 | case Id::KW_DLeftBracket: return Kind::KW;
|
406 | case Id::KW_Bang: return Kind::KW;
|
407 | case Id::KW_For: return Kind::KW;
|
408 | case Id::KW_While: return Kind::KW;
|
409 | case Id::KW_Until: return Kind::KW;
|
410 | case Id::KW_Do: return Kind::KW;
|
411 | case Id::KW_Done: return Kind::KW;
|
412 | case Id::KW_In: return Kind::KW;
|
413 | case Id::KW_Case: return Kind::KW;
|
414 | case Id::KW_Esac: return Kind::KW;
|
415 | case Id::KW_If: return Kind::KW;
|
416 | case Id::KW_Fi: return Kind::KW;
|
417 | case Id::KW_Then: return Kind::KW;
|
418 | case Id::KW_Else: return Kind::KW;
|
419 | case Id::KW_Elif: return Kind::KW;
|
420 | case Id::KW_Function: return Kind::KW;
|
421 | case Id::KW_Time: return Kind::KW;
|
422 | case Id::KW_Const: return Kind::KW;
|
423 | case Id::KW_Var: return Kind::KW;
|
424 | case Id::KW_SetVar: return Kind::KW;
|
425 | case Id::KW_SetGlobal: return Kind::KW;
|
426 | case Id::KW_Call: return Kind::KW;
|
427 | case Id::KW_Proc: return Kind::KW;
|
428 | case Id::KW_Typed: return Kind::KW;
|
429 | case Id::KW_Func: return Kind::KW;
|
430 | case Id::ControlFlow_Break: return Kind::ControlFlow;
|
431 | case Id::ControlFlow_Continue: return Kind::ControlFlow;
|
432 | case Id::ControlFlow_Return: return Kind::ControlFlow;
|
433 | case Id::ControlFlow_Exit: return Kind::ControlFlow;
|
434 | case Id::LookAhead_FuncParens: return Kind::LookAhead;
|
435 | case Id::Glob_LBracket: return Kind::Glob;
|
436 | case Id::Glob_RBracket: return Kind::Glob;
|
437 | case Id::Glob_Star: return Kind::Glob;
|
438 | case Id::Glob_QMark: return Kind::Glob;
|
439 | case Id::Glob_Bang: return Kind::Glob;
|
440 | case Id::Glob_Caret: return Kind::Glob;
|
441 | case Id::Glob_EscapedChar: return Kind::Glob;
|
442 | case Id::Glob_BadBackslash: return Kind::Glob;
|
443 | case Id::Glob_CleanLiterals: return Kind::Glob;
|
444 | case Id::Glob_OtherLiteral: return Kind::Glob;
|
445 | case Id::Format_EscapedPercent: return Kind::Format;
|
446 | case Id::Format_Percent: return Kind::Format;
|
447 | case Id::Format_Flag: return Kind::Format;
|
448 | case Id::Format_Num: return Kind::Format;
|
449 | case Id::Format_Dot: return Kind::Format;
|
450 | case Id::Format_Type: return Kind::Format;
|
451 | case Id::Format_Star: return Kind::Format;
|
452 | case Id::Format_Time: return Kind::Format;
|
453 | case Id::Format_Zero: return Kind::Format;
|
454 | case Id::PS_Subst: return Kind::PS;
|
455 | case Id::PS_Octal3: return Kind::PS;
|
456 | case Id::PS_LBrace: return Kind::PS;
|
457 | case Id::PS_RBrace: return Kind::PS;
|
458 | case Id::PS_Literals: return Kind::PS;
|
459 | case Id::PS_BadBackslash: return Kind::PS;
|
460 | case Id::Range_Int: return Kind::Range;
|
461 | case Id::Range_Char: return Kind::Range;
|
462 | case Id::Range_Dots: return Kind::Range;
|
463 | case Id::Range_Other: return Kind::Range;
|
464 | case Id::J8_LBracket: return Kind::J8;
|
465 | case Id::J8_RBracket: return Kind::J8;
|
466 | case Id::J8_LBrace: return Kind::J8;
|
467 | case Id::J8_RBrace: return Kind::J8;
|
468 | case Id::J8_Comma: return Kind::J8;
|
469 | case Id::J8_Colon: return Kind::J8;
|
470 | case Id::J8_Null: return Kind::J8;
|
471 | case Id::J8_Bool: return Kind::J8;
|
472 | case Id::J8_Int: return Kind::J8;
|
473 | case Id::J8_Float: return Kind::J8;
|
474 | case Id::J8_String: return Kind::J8;
|
475 | case Id::J8_Identifier: return Kind::J8;
|
476 | case Id::J8_Newline: return Kind::J8;
|
477 | case Id::J8_Tab: return Kind::J8;
|
478 | case Id::J8_LParen: return Kind::J8;
|
479 | case Id::J8_RParen: return Kind::J8;
|
480 | case Id::J8_Operator: return Kind::J8;
|
481 | case Id::BoolUnary_z: return Kind::BoolUnary;
|
482 | case Id::BoolUnary_n: return Kind::BoolUnary;
|
483 | case Id::BoolUnary_o: return Kind::BoolUnary;
|
484 | case Id::BoolUnary_t: return Kind::BoolUnary;
|
485 | case Id::BoolUnary_v: return Kind::BoolUnary;
|
486 | case Id::BoolUnary_R: return Kind::BoolUnary;
|
487 | case Id::BoolUnary_a: return Kind::BoolUnary;
|
488 | case Id::BoolUnary_b: return Kind::BoolUnary;
|
489 | case Id::BoolUnary_c: return Kind::BoolUnary;
|
490 | case Id::BoolUnary_d: return Kind::BoolUnary;
|
491 | case Id::BoolUnary_e: return Kind::BoolUnary;
|
492 | case Id::BoolUnary_f: return Kind::BoolUnary;
|
493 | case Id::BoolUnary_g: return Kind::BoolUnary;
|
494 | case Id::BoolUnary_h: return Kind::BoolUnary;
|
495 | case Id::BoolUnary_k: return Kind::BoolUnary;
|
496 | case Id::BoolUnary_L: return Kind::BoolUnary;
|
497 | case Id::BoolUnary_p: return Kind::BoolUnary;
|
498 | case Id::BoolUnary_r: return Kind::BoolUnary;
|
499 | case Id::BoolUnary_s: return Kind::BoolUnary;
|
500 | case Id::BoolUnary_S: return Kind::BoolUnary;
|
501 | case Id::BoolUnary_u: return Kind::BoolUnary;
|
502 | case Id::BoolUnary_w: return Kind::BoolUnary;
|
503 | case Id::BoolUnary_x: return Kind::BoolUnary;
|
504 | case Id::BoolUnary_O: return Kind::BoolUnary;
|
505 | case Id::BoolUnary_G: return Kind::BoolUnary;
|
506 | case Id::BoolUnary_N: return Kind::BoolUnary;
|
507 | case Id::BoolBinary_GlobEqual: return Kind::BoolBinary;
|
508 | case Id::BoolBinary_GlobDEqual: return Kind::BoolBinary;
|
509 | case Id::BoolBinary_GlobNEqual: return Kind::BoolBinary;
|
510 | case Id::BoolBinary_EqualTilde: return Kind::BoolBinary;
|
511 | case Id::BoolBinary_ef: return Kind::BoolBinary;
|
512 | case Id::BoolBinary_nt: return Kind::BoolBinary;
|
513 | case Id::BoolBinary_ot: return Kind::BoolBinary;
|
514 | case Id::BoolBinary_eq: return Kind::BoolBinary;
|
515 | case Id::BoolBinary_ne: return Kind::BoolBinary;
|
516 | case Id::BoolBinary_gt: return Kind::BoolBinary;
|
517 | case Id::BoolBinary_ge: return Kind::BoolBinary;
|
518 | case Id::BoolBinary_lt: return Kind::BoolBinary;
|
519 | case Id::BoolBinary_le: return Kind::BoolBinary;
|
520 | case Id::BoolBinary_Equal: return Kind::BoolBinary;
|
521 | case Id::BoolBinary_DEqual: return Kind::BoolBinary;
|
522 | case Id::BoolBinary_NEqual: return Kind::BoolBinary;
|
523 | }
|
524 | FAIL(kShouldNotGetHere);
|
525 | }
|
526 |
|
527 | types_asdl::opt_group_t OptionGroupNum(BigStr* s) {
|
528 | int length = len(s);
|
529 | if (length == 0) return 0; // consts.NO_INDEX
|
530 |
|
531 | const char* data = s->data_;
|
532 | switch (data[0]) {
|
533 | case 'o':
|
534 | if (length == 7 && memcmp("oil:all", data, 7) == 0) return 3;
|
535 | if (length == 11 && memcmp("oil:upgrade", data, 11) == 0) return 2;
|
536 | break;
|
537 | case 's':
|
538 | if (length == 10 && memcmp("strict:all", data, 10) == 0) return 1;
|
539 | break;
|
540 | case 'y':
|
541 | if (length == 7 && memcmp("ysh:all", data, 7) == 0) return 3;
|
542 | if (length == 11 && memcmp("ysh:upgrade", data, 11) == 0) return 2;
|
543 | break;
|
544 | }
|
545 |
|
546 | return 0; // consts.NO_INDEX
|
547 | }
|
548 |
|
549 | option_asdl::option_t OptionNum(BigStr* s) {
|
550 | int length = len(s);
|
551 | if (length == 0) return 0; // consts.NO_INDEX
|
552 |
|
553 | const char* data = s->data_;
|
554 | switch (data[0]) {
|
555 | case '_':
|
556 | if (length == 18 && memcmp("_allow_command_sub", data, 18) == 0) return 21;
|
557 | if (length == 18 && memcmp("_allow_process_sub", data, 18) == 0) return 22;
|
558 | if (length == 13 && memcmp("_running_trap", data, 13) == 0) return 25;
|
559 | if (length == 12 && memcmp("_running_hay", data, 12) == 0) return 26;
|
560 | if (length == 14 && memcmp("_no_debug_trap", data, 14) == 0) return 27;
|
561 | if (length == 12 && memcmp("_no_err_trap", data, 12) == 0) return 28;
|
562 | break;
|
563 | case 'a':
|
564 | if (length == 17 && memcmp("assoc_expand_once", data, 17) == 0) return 73;
|
565 | if (length == 6 && memcmp("autocd", data, 6) == 0) return 74;
|
566 | break;
|
567 | case 'c':
|
568 | if (length == 19 && memcmp("command_sub_errexit", data, 19) == 0) return 49;
|
569 | if (length == 7 && memcmp("cmdhist", data, 7) == 0) return 72;
|
570 | if (length == 11 && memcmp("cdable_vars", data, 11) == 0) return 75;
|
571 | if (length == 7 && memcmp("cdspell", data, 7) == 0) return 76;
|
572 | if (length == 9 && memcmp("checkhash", data, 9) == 0) return 77;
|
573 | if (length == 9 && memcmp("checkjobs", data, 9) == 0) return 78;
|
574 | if (length == 12 && memcmp("checkwinsize", data, 12) == 0) return 79;
|
575 | if (length == 18 && memcmp("complete_fullquote", data, 18) == 0) return 80;
|
576 | break;
|
577 | case 'd':
|
578 | if (length == 13 && memcmp("dynamic_scope", data, 13) == 0) return 23;
|
579 | if (length == 8 && memcmp("dashglob", data, 8) == 0) return 48;
|
580 | if (length == 9 && memcmp("direxpand", data, 9) == 0) return 81;
|
581 | if (length == 8 && memcmp("dirspell", data, 8) == 0) return 82;
|
582 | if (length == 7 && memcmp("dotglob", data, 7) == 0) return 83;
|
583 | break;
|
584 | case 'e':
|
585 | if (length == 7 && memcmp("errexit", data, 7) == 0) return 1;
|
586 | if (length == 5 && memcmp("emacs", data, 5) == 0) return 14;
|
587 | if (length == 7 && memcmp("extglob", data, 7) == 0) return 18;
|
588 | if (length == 17 && memcmp("eval_unsafe_arith", data, 17) == 0) return 20;
|
589 | if (length == 14 && memcmp("expand_aliases", data, 14) == 0) return 67;
|
590 | if (length == 8 && memcmp("execfail", data, 8) == 0) return 84;
|
591 | if (length == 8 && memcmp("extdebug", data, 8) == 0) return 85;
|
592 | if (length == 8 && memcmp("extquote", data, 8) == 0) return 86;
|
593 | break;
|
594 | case 'f':
|
595 | if (length == 8 && memcmp("failglob", data, 8) == 0) return 17;
|
596 | if (length == 13 && memcmp("force_fignore", data, 13) == 0) return 87;
|
597 | break;
|
598 | case 'g':
|
599 | if (length == 15 && memcmp("globasciiranges", data, 15) == 0) return 88;
|
600 | if (length == 8 && memcmp("globstar", data, 8) == 0) return 89;
|
601 | if (length == 10 && memcmp("gnu_errfmt", data, 10) == 0) return 90;
|
602 | break;
|
603 | case 'h':
|
604 | if (length == 7 && memcmp("hashall", data, 7) == 0) return 16;
|
605 | if (length == 10 && memcmp("histappend", data, 10) == 0) return 70;
|
606 | if (length == 12 && memcmp("hostcomplete", data, 12) == 0) return 71;
|
607 | if (length == 10 && memcmp("histreedit", data, 10) == 0) return 91;
|
608 | if (length == 10 && memcmp("histverify", data, 10) == 0) return 92;
|
609 | if (length == 9 && memcmp("huponexit", data, 9) == 0) return 93;
|
610 | break;
|
611 | case 'i':
|
612 | if (length == 15 && memcmp("inherit_errexit", data, 15) == 0) return 4;
|
613 | if (length == 11 && memcmp("interactive", data, 11) == 0) return 15;
|
614 | if (length == 20 && memcmp("interactive_comments", data, 20) == 0) return 94;
|
615 | break;
|
616 | case 'l':
|
617 | if (length == 8 && memcmp("lastpipe", data, 8) == 0) return 68;
|
618 | if (length == 7 && memcmp("lithist", data, 7) == 0) return 95;
|
619 | if (length == 16 && memcmp("localvar_inherit", data, 16) == 0) return 96;
|
620 | if (length == 14 && memcmp("localvar_unset", data, 14) == 0) return 97;
|
621 | if (length == 11 && memcmp("login_shell", data, 11) == 0) return 98;
|
622 | break;
|
623 | case 'm':
|
624 | if (length == 8 && memcmp("mailwarn", data, 8) == 0) return 99;
|
625 | break;
|
626 | case 'n':
|
627 | if (length == 7 && memcmp("nounset", data, 7) == 0) return 2;
|
628 | if (length == 8 && memcmp("nullglob", data, 8) == 0) return 5;
|
629 | if (length == 6 && memcmp("noexec", data, 6) == 0) return 7;
|
630 | if (length == 6 && memcmp("noglob", data, 6) == 0) return 10;
|
631 | if (length == 9 && memcmp("noclobber", data, 9) == 0) return 11;
|
632 | if (length == 11 && memcmp("nocasematch", data, 11) == 0) return 19;
|
633 | if (length == 23 && memcmp("no_empty_cmd_completion", data, 23) == 0) return 100;
|
634 | if (length == 10 && memcmp("nocaseglob", data, 10) == 0) return 101;
|
635 | break;
|
636 | case 'p':
|
637 | if (length == 8 && memcmp("pipefail", data, 8) == 0) return 3;
|
638 | if (length == 5 && memcmp("posix", data, 5) == 0) return 12;
|
639 | if (length == 8 && memcmp("parse_at", data, 8) == 0) return 38;
|
640 | if (length == 10 && memcmp("parse_proc", data, 10) == 0) return 39;
|
641 | if (length == 10 && memcmp("parse_func", data, 10) == 0) return 40;
|
642 | if (length == 11 && memcmp("parse_brace", data, 11) == 0) return 41;
|
643 | if (length == 13 && memcmp("parse_bracket", data, 13) == 0) return 42;
|
644 | if (length == 12 && memcmp("parse_equals", data, 12) == 0) return 43;
|
645 | if (length == 11 && memcmp("parse_paren", data, 11) == 0) return 44;
|
646 | if (length == 16 && memcmp("parse_ysh_string", data, 16) == 0) return 45;
|
647 | if (length == 18 && memcmp("parse_triple_quote", data, 18) == 0) return 46;
|
648 | if (length == 16 && memcmp("process_sub_fail", data, 16) == 0) return 50;
|
649 | if (length == 12 && memcmp("parse_at_all", data, 12) == 0) return 55;
|
650 | if (length == 15 && memcmp("parse_backslash", data, 15) == 0) return 56;
|
651 | if (length == 15 && memcmp("parse_backticks", data, 15) == 0) return 57;
|
652 | if (length == 12 && memcmp("parse_dollar", data, 12) == 0) return 58;
|
653 | if (length == 13 && memcmp("parse_ignored", data, 13) == 0) return 59;
|
654 | if (length == 14 && memcmp("parse_sh_arith", data, 14) == 0) return 60;
|
655 | if (length == 12 && memcmp("parse_dparen", data, 12) == 0) return 61;
|
656 | if (length == 14 && memcmp("parse_dbracket", data, 14) == 0) return 62;
|
657 | if (length == 15 && memcmp("parse_bare_word", data, 15) == 0) return 63;
|
658 | if (length == 8 && memcmp("progcomp", data, 8) == 0) return 69;
|
659 | if (length == 14 && memcmp("progcomp_alias", data, 14) == 0) return 102;
|
660 | if (length == 10 && memcmp("promptvars", data, 10) == 0) return 103;
|
661 | break;
|
662 | case 'r':
|
663 | if (length == 15 && memcmp("redefine_module", data, 15) == 0) return 24;
|
664 | if (length == 18 && memcmp("redefine_proc_func", data, 18) == 0) return 54;
|
665 | if (length == 16 && memcmp("restricted_shell", data, 16) == 0) return 104;
|
666 | break;
|
667 | case 's':
|
668 | if (length == 11 && memcmp("strict_argv", data, 11) == 0) return 29;
|
669 | if (length == 12 && memcmp("strict_arith", data, 12) == 0) return 30;
|
670 | if (length == 12 && memcmp("strict_array", data, 12) == 0) return 31;
|
671 | if (length == 19 && memcmp("strict_control_flow", data, 19) == 0) return 32;
|
672 | if (length == 14 && memcmp("strict_errexit", data, 14) == 0) return 33;
|
673 | if (length == 14 && memcmp("strict_nameref", data, 14) == 0) return 34;
|
674 | if (length == 16 && memcmp("strict_word_eval", data, 16) == 0) return 35;
|
675 | if (length == 12 && memcmp("strict_tilde", data, 12) == 0) return 36;
|
676 | if (length == 11 && memcmp("strict_glob", data, 11) == 0) return 37;
|
677 | if (length == 16 && memcmp("simple_word_eval", data, 16) == 0) return 47;
|
678 | if (length == 17 && memcmp("sigpipe_status_ok", data, 17) == 0) return 53;
|
679 | if (length == 11 && memcmp("simple_echo", data, 11) == 0) return 64;
|
680 | if (length == 19 && memcmp("simple_eval_builtin", data, 19) == 0) return 65;
|
681 | if (length == 19 && memcmp("simple_test_builtin", data, 19) == 0) return 66;
|
682 | if (length == 13 && memcmp("shift_verbose", data, 13) == 0) return 105;
|
683 | if (length == 10 && memcmp("sourcepath", data, 10) == 0) return 106;
|
684 | break;
|
685 | case 'v':
|
686 | if (length == 15 && memcmp("verbose_errexit", data, 15) == 0) return 6;
|
687 | if (length == 7 && memcmp("verbose", data, 7) == 0) return 9;
|
688 | if (length == 2 && memcmp("vi", data, 2) == 0) return 13;
|
689 | break;
|
690 | case 'x':
|
691 | if (length == 6 && memcmp("xtrace", data, 6) == 0) return 8;
|
692 | if (length == 11 && memcmp("xtrace_rich", data, 11) == 0) return 51;
|
693 | if (length == 14 && memcmp("xtrace_details", data, 14) == 0) return 52;
|
694 | if (length == 8 && memcmp("xpg_echo", data, 8) == 0) return 107;
|
695 | break;
|
696 | }
|
697 |
|
698 | return 0; // consts.NO_INDEX
|
699 | }
|
700 |
|
701 | builtin_t LookupNormalBuiltin(BigStr* s) {
|
702 | int length = len(s);
|
703 | if (length == 0) return 0; // consts.NO_INDEX
|
704 |
|
705 | const char* data = s->data_;
|
706 | switch (data[0]) {
|
707 | case '[':
|
708 | if (length == 1 && memcmp("[", data, 1) == 0) return 70;
|
709 | break;
|
710 | case '_':
|
711 | if (length == 5 && memcmp("__cat", data, 5) == 0) return 73;
|
712 | break;
|
713 | case 'a':
|
714 | if (length == 5 && memcmp("alias", data, 5) == 0) return 48;
|
715 | if (length == 6 && memcmp("append", data, 6) == 0) return 51;
|
716 | break;
|
717 | case 'b':
|
718 | if (length == 2 && memcmp("bg", data, 2) == 0) return 35;
|
719 | if (length == 4 && memcmp("bind", data, 4) == 0) return 50;
|
720 | if (length == 10 && memcmp("boolstatus", data, 10) == 0) return 68;
|
721 | break;
|
722 | case 'c':
|
723 | if (length == 2 && memcmp("cd", data, 2) == 0) return 24;
|
724 | if (length == 8 && memcmp("complete", data, 8) == 0) return 37;
|
725 | if (length == 7 && memcmp("compgen", data, 7) == 0) return 38;
|
726 | if (length == 7 && memcmp("compopt", data, 7) == 0) return 39;
|
727 | if (length == 10 && memcmp("compadjust", data, 10) == 0) return 40;
|
728 | if (length == 10 && memcmp("compexport", data, 10) == 0) return 41;
|
729 | if (length == 7 && memcmp("command", data, 7) == 0) return 43;
|
730 | if (length == 3 && memcmp("ctx", data, 3) == 0) return 66;
|
731 | break;
|
732 | case 'd':
|
733 | if (length == 4 && memcmp("dirs", data, 4) == 0) return 27;
|
734 | break;
|
735 | case 'e':
|
736 | if (length == 4 && memcmp("echo", data, 4) == 0) return 20;
|
737 | if (length == 5 && memcmp("error", data, 5) == 0) return 60;
|
738 | break;
|
739 | case 'f':
|
740 | if (length == 5 && memcmp("false", data, 5) == 0) return 17;
|
741 | if (length == 2 && memcmp("fg", data, 2) == 0) return 34;
|
742 | if (length == 6 && memcmp("failed", data, 6) == 0) return 61;
|
743 | if (length == 4 && memcmp("fork", data, 4) == 0) return 62;
|
744 | if (length == 8 && memcmp("forkwait", data, 8) == 0) return 63;
|
745 | if (length == 5 && memcmp("fopen", data, 5) == 0) return 64;
|
746 | break;
|
747 | case 'g':
|
748 | if (length == 7 && memcmp("getopts", data, 7) == 0) return 42;
|
749 | break;
|
750 | case 'h':
|
751 | if (length == 4 && memcmp("hash", data, 4) == 0) return 45;
|
752 | if (length == 4 && memcmp("help", data, 4) == 0) return 46;
|
753 | if (length == 7 && memcmp("history", data, 7) == 0) return 47;
|
754 | if (length == 3 && memcmp("hay", data, 3) == 0) return 56;
|
755 | if (length == 7 && memcmp("haynode", data, 7) == 0) return 57;
|
756 | break;
|
757 | case 'i':
|
758 | if (length == 7 && memcmp("is-main", data, 7) == 0) return 72;
|
759 | break;
|
760 | case 'j':
|
761 | if (length == 4 && memcmp("jobs", data, 4) == 0) return 33;
|
762 | if (length == 4 && memcmp("json", data, 4) == 0) return 53;
|
763 | if (length == 5 && memcmp("json8", data, 5) == 0) return 54;
|
764 | break;
|
765 | case 'm':
|
766 | if (length == 7 && memcmp("mapfile", data, 7) == 0) return 22;
|
767 | if (length == 6 && memcmp("module", data, 6) == 0) return 58;
|
768 | break;
|
769 | case 'p':
|
770 | if (length == 6 && memcmp("printf", data, 6) == 0) return 21;
|
771 | if (length == 5 && memcmp("pushd", data, 5) == 0) return 25;
|
772 | if (length == 4 && memcmp("popd", data, 4) == 0) return 26;
|
773 | if (length == 3 && memcmp("pwd", data, 3) == 0) return 28;
|
774 | if (length == 2 && memcmp("pp", data, 2) == 0) return 55;
|
775 | if (length == 14 && memcmp("push-registers", data, 14) == 0) return 71;
|
776 | break;
|
777 | case 'r':
|
778 | if (length == 4 && memcmp("read", data, 4) == 0) return 19;
|
779 | if (length == 9 && memcmp("readarray", data, 9) == 0) return 23;
|
780 | if (length == 7 && memcmp("runproc", data, 7) == 0) return 67;
|
781 | break;
|
782 | case 's':
|
783 | if (length == 6 && memcmp("source", data, 6) == 0) return 29;
|
784 | if (length == 5 && memcmp("shopt", data, 5) == 0) return 36;
|
785 | if (length == 5 && memcmp("shvar", data, 5) == 0) return 65;
|
786 | break;
|
787 | case 't':
|
788 | if (length == 4 && memcmp("true", data, 4) == 0) return 16;
|
789 | if (length == 3 && memcmp("try", data, 3) == 0) return 18;
|
790 | if (length == 4 && memcmp("type", data, 4) == 0) return 44;
|
791 | if (length == 4 && memcmp("test", data, 4) == 0) return 69;
|
792 | break;
|
793 | case 'u':
|
794 | if (length == 5 && memcmp("umask", data, 5) == 0) return 30;
|
795 | if (length == 6 && memcmp("ulimit", data, 6) == 0) return 31;
|
796 | if (length == 7 && memcmp("unalias", data, 7) == 0) return 49;
|
797 | if (length == 3 && memcmp("use", data, 3) == 0) return 59;
|
798 | break;
|
799 | case 'w':
|
800 | if (length == 4 && memcmp("wait", data, 4) == 0) return 32;
|
801 | if (length == 5 && memcmp("write", data, 5) == 0) return 52;
|
802 | break;
|
803 | }
|
804 |
|
805 | return 0; // consts.NO_INDEX
|
806 | }
|
807 |
|
808 | builtin_t LookupAssignBuiltin(BigStr* s) {
|
809 | int length = len(s);
|
810 | if (length == 0) return 0; // consts.NO_INDEX
|
811 |
|
812 | const char* data = s->data_;
|
813 | switch (data[0]) {
|
814 | case 'd':
|
815 | if (length == 7 && memcmp("declare", data, 7) == 0) return 13;
|
816 | break;
|
817 | case 'e':
|
818 | if (length == 6 && memcmp("export", data, 6) == 0) return 15;
|
819 | break;
|
820 | case 'l':
|
821 | if (length == 5 && memcmp("local", data, 5) == 0) return 12;
|
822 | break;
|
823 | case 'r':
|
824 | if (length == 8 && memcmp("readonly", data, 8) == 0) return 11;
|
825 | break;
|
826 | case 't':
|
827 | if (length == 7 && memcmp("typeset", data, 7) == 0) return 14;
|
828 | break;
|
829 | }
|
830 |
|
831 | return 0; // consts.NO_INDEX
|
832 | }
|
833 |
|
834 | builtin_t LookupSpecialBuiltin(BigStr* s) {
|
835 | int length = len(s);
|
836 | if (length == 0) return 0; // consts.NO_INDEX
|
837 |
|
838 | const char* data = s->data_;
|
839 | switch (data[0]) {
|
840 | case '.':
|
841 | if (length == 1 && memcmp(".", data, 1) == 0) return 2;
|
842 | break;
|
843 | case ':':
|
844 | if (length == 1 && memcmp(":", data, 1) == 0) return 1;
|
845 | break;
|
846 | case 'b':
|
847 | if (length == 7 && memcmp("builtin", data, 7) == 0) return 10;
|
848 | break;
|
849 | case 'e':
|
850 | if (length == 4 && memcmp("exec", data, 4) == 0) return 3;
|
851 | if (length == 4 && memcmp("eval", data, 4) == 0) return 4;
|
852 | break;
|
853 | case 's':
|
854 | if (length == 3 && memcmp("set", data, 3) == 0) return 5;
|
855 | if (length == 5 && memcmp("shift", data, 5) == 0) return 6;
|
856 | break;
|
857 | case 't':
|
858 | if (length == 5 && memcmp("times", data, 5) == 0) return 7;
|
859 | if (length == 4 && memcmp("trap", data, 4) == 0) return 8;
|
860 | break;
|
861 | case 'u':
|
862 | if (length == 5 && memcmp("unset", data, 5) == 0) return 9;
|
863 | break;
|
864 | }
|
865 |
|
866 | return 0; // consts.NO_INDEX
|
867 | }
|
868 |
|
869 | bool IsControlFlow(BigStr* s) {
|
870 | int length = len(s);
|
871 | if (length == 0) return false;
|
872 |
|
873 | const char* data = s->data_;
|
874 | switch (data[0]) {
|
875 | case 'b':
|
876 | if (length == 5 && memcmp("break", data, 5) == 0) return true;
|
877 | break;
|
878 | case 'c':
|
879 | if (length == 8 && memcmp("continue", data, 8) == 0) return true;
|
880 | break;
|
881 | case 'e':
|
882 | if (length == 4 && memcmp("exit", data, 4) == 0) return true;
|
883 | break;
|
884 | case 'r':
|
885 | if (length == 6 && memcmp("return", data, 6) == 0) return true;
|
886 | break;
|
887 | }
|
888 |
|
889 | return false;
|
890 | }
|
891 |
|
892 | GLOBAL_STR(kControlFlowName_310, "break");
|
893 | GLOBAL_STR(kControlFlowName_311, "continue");
|
894 | GLOBAL_STR(kControlFlowName_312, "return");
|
895 | GLOBAL_STR(kControlFlowName_313, "exit");
|
896 |
|
897 | BigStr* ControlFlowName(int i) {
|
898 | switch (i) {
|
899 | case 310:
|
900 | return kControlFlowName_310;
|
901 | break;
|
902 | case 311:
|
903 | return kControlFlowName_311;
|
904 | break;
|
905 | case 312:
|
906 | return kControlFlowName_312;
|
907 | break;
|
908 | case 313:
|
909 | return kControlFlowName_313;
|
910 | break;
|
911 | default:
|
912 | FAIL(kShouldNotGetHere);
|
913 | }
|
914 | }
|
915 |
|
916 | bool IsKeyword(BigStr* s) {
|
917 | int length = len(s);
|
918 | if (length == 0) return false;
|
919 |
|
920 | const char* data = s->data_;
|
921 | switch (data[0]) {
|
922 | case '!':
|
923 | if (length == 1 && memcmp("!", data, 1) == 0) return true;
|
924 | break;
|
925 | case '=':
|
926 | if (length == 1 && memcmp("=", data, 1) == 0) return true;
|
927 | break;
|
928 | case '[':
|
929 | if (length == 2 && memcmp("[[", data, 2) == 0) return true;
|
930 | break;
|
931 | case ']':
|
932 | if (length == 2 && memcmp("]]", data, 2) == 0) return true;
|
933 | break;
|
934 | case 'c':
|
935 | if (length == 4 && memcmp("case", data, 4) == 0) return true;
|
936 | if (length == 5 && memcmp("const", data, 5) == 0) return true;
|
937 | if (length == 4 && memcmp("call", data, 4) == 0) return true;
|
938 | break;
|
939 | case 'd':
|
940 | if (length == 2 && memcmp("do", data, 2) == 0) return true;
|
941 | if (length == 4 && memcmp("done", data, 4) == 0) return true;
|
942 | break;
|
943 | case 'e':
|
944 | if (length == 4 && memcmp("esac", data, 4) == 0) return true;
|
945 | if (length == 4 && memcmp("else", data, 4) == 0) return true;
|
946 | if (length == 4 && memcmp("elif", data, 4) == 0) return true;
|
947 | break;
|
948 | case 'f':
|
949 | if (length == 3 && memcmp("for", data, 3) == 0) return true;
|
950 | if (length == 2 && memcmp("fi", data, 2) == 0) return true;
|
951 | if (length == 8 && memcmp("function", data, 8) == 0) return true;
|
952 | if (length == 4 && memcmp("func", data, 4) == 0) return true;
|
953 | break;
|
954 | case 'i':
|
955 | if (length == 2 && memcmp("in", data, 2) == 0) return true;
|
956 | if (length == 2 && memcmp("if", data, 2) == 0) return true;
|
957 | break;
|
958 | case 'p':
|
959 | if (length == 4 && memcmp("proc", data, 4) == 0) return true;
|
960 | break;
|
961 | case 's':
|
962 | if (length == 6 && memcmp("setvar", data, 6) == 0) return true;
|
963 | if (length == 9 && memcmp("setglobal", data, 9) == 0) return true;
|
964 | break;
|
965 | case 't':
|
966 | if (length == 4 && memcmp("then", data, 4) == 0) return true;
|
967 | if (length == 4 && memcmp("time", data, 4) == 0) return true;
|
968 | if (length == 5 && memcmp("typed", data, 5) == 0) return true;
|
969 | break;
|
970 | case 'u':
|
971 | if (length == 5 && memcmp("until", data, 5) == 0) return true;
|
972 | break;
|
973 | case 'v':
|
974 | if (length == 3 && memcmp("var", data, 3) == 0) return true;
|
975 | break;
|
976 | case 'w':
|
977 | if (length == 5 && memcmp("while", data, 5) == 0) return true;
|
978 | break;
|
979 | case '{':
|
980 | if (length == 1 && memcmp("{", data, 1) == 0) return true;
|
981 | break;
|
982 | case '}':
|
983 | if (length == 1 && memcmp("}", data, 1) == 0) return true;
|
984 | break;
|
985 | }
|
986 |
|
987 | return false;
|
988 | }
|
989 |
|
990 | BigStr* LookupCharC(BigStr* c) {
|
991 | assert(len(c) == 1);
|
992 |
|
993 | char ch = c->data_[0];
|
994 |
|
995 | // TODO-intern: return value
|
996 | switch (ch) {
|
997 | case '\"':
|
998 | return StrFromC("\"", 1);
|
999 | break;
|
1000 | case '\'':
|
1001 | return StrFromC("\'", 1);
|
1002 | break;
|
1003 | case '/':
|
1004 | return StrFromC("/", 1);
|
1005 | break;
|
1006 | case '0':
|
1007 | return StrFromC("\0", 1);
|
1008 | break;
|
1009 | case 'E':
|
1010 | return StrFromC("\x1b", 1);
|
1011 | break;
|
1012 | case '\\':
|
1013 | return StrFromC("\\", 1);
|
1014 | break;
|
1015 | case 'a':
|
1016 | return StrFromC("\a", 1);
|
1017 | break;
|
1018 | case 'b':
|
1019 | return StrFromC("\b", 1);
|
1020 | break;
|
1021 | case 'e':
|
1022 | return StrFromC("\x1b", 1);
|
1023 | break;
|
1024 | case 'f':
|
1025 | return StrFromC("\f", 1);
|
1026 | break;
|
1027 | case 'n':
|
1028 | return StrFromC("\n", 1);
|
1029 | break;
|
1030 | case 'r':
|
1031 | return StrFromC("\r", 1);
|
1032 | break;
|
1033 | case 't':
|
1034 | return StrFromC("\t", 1);
|
1035 | break;
|
1036 | case 'v':
|
1037 | return StrFromC("\v", 1);
|
1038 | break;
|
1039 | default:
|
1040 | assert(0);
|
1041 |
|
1042 | }
|
1043 | }
|
1044 | BigStr* LookupCharPrompt(BigStr* c) {
|
1045 | assert(len(c) == 1);
|
1046 |
|
1047 | char ch = c->data_[0];
|
1048 |
|
1049 | // TODO-intern: return value
|
1050 | switch (ch) {
|
1051 | case '\\':
|
1052 | return StrFromC("\\", 1);
|
1053 | break;
|
1054 | case 'a':
|
1055 | return StrFromC("\a", 1);
|
1056 | break;
|
1057 | case 'e':
|
1058 | return StrFromC("\x1b", 1);
|
1059 | break;
|
1060 | case 'n':
|
1061 | return StrFromC("\n", 1);
|
1062 | break;
|
1063 | case 'r':
|
1064 | return StrFromC("\r", 1);
|
1065 | break;
|
1066 | default:
|
1067 | return nullptr;
|
1068 |
|
1069 | }
|
1070 | }
|
1071 | GLOBAL_STR(kOptionName_1, "errexit");
|
1072 | GLOBAL_STR(kOptionName_2, "nounset");
|
1073 | GLOBAL_STR(kOptionName_3, "pipefail");
|
1074 | GLOBAL_STR(kOptionName_4, "inherit_errexit");
|
1075 | GLOBAL_STR(kOptionName_5, "nullglob");
|
1076 | GLOBAL_STR(kOptionName_6, "verbose_errexit");
|
1077 | GLOBAL_STR(kOptionName_7, "noexec");
|
1078 | GLOBAL_STR(kOptionName_8, "xtrace");
|
1079 | GLOBAL_STR(kOptionName_9, "verbose");
|
1080 | GLOBAL_STR(kOptionName_10, "noglob");
|
1081 | GLOBAL_STR(kOptionName_11, "noclobber");
|
1082 | GLOBAL_STR(kOptionName_12, "posix");
|
1083 | GLOBAL_STR(kOptionName_13, "vi");
|
1084 | GLOBAL_STR(kOptionName_14, "emacs");
|
1085 | GLOBAL_STR(kOptionName_15, "interactive");
|
1086 | GLOBAL_STR(kOptionName_16, "hashall");
|
1087 | GLOBAL_STR(kOptionName_17, "failglob");
|
1088 | GLOBAL_STR(kOptionName_18, "extglob");
|
1089 | GLOBAL_STR(kOptionName_19, "nocasematch");
|
1090 | GLOBAL_STR(kOptionName_20, "eval_unsafe_arith");
|
1091 | GLOBAL_STR(kOptionName_21, "_allow_command_sub");
|
1092 | GLOBAL_STR(kOptionName_22, "_allow_process_sub");
|
1093 | GLOBAL_STR(kOptionName_23, "dynamic_scope");
|
1094 | GLOBAL_STR(kOptionName_24, "redefine_module");
|
1095 | GLOBAL_STR(kOptionName_25, "_running_trap");
|
1096 | GLOBAL_STR(kOptionName_26, "_running_hay");
|
1097 | GLOBAL_STR(kOptionName_27, "_no_debug_trap");
|
1098 | GLOBAL_STR(kOptionName_28, "_no_err_trap");
|
1099 | GLOBAL_STR(kOptionName_29, "strict_argv");
|
1100 | GLOBAL_STR(kOptionName_30, "strict_arith");
|
1101 | GLOBAL_STR(kOptionName_31, "strict_array");
|
1102 | GLOBAL_STR(kOptionName_32, "strict_control_flow");
|
1103 | GLOBAL_STR(kOptionName_33, "strict_errexit");
|
1104 | GLOBAL_STR(kOptionName_34, "strict_nameref");
|
1105 | GLOBAL_STR(kOptionName_35, "strict_word_eval");
|
1106 | GLOBAL_STR(kOptionName_36, "strict_tilde");
|
1107 | GLOBAL_STR(kOptionName_37, "strict_glob");
|
1108 | GLOBAL_STR(kOptionName_38, "parse_at");
|
1109 | GLOBAL_STR(kOptionName_39, "parse_proc");
|
1110 | GLOBAL_STR(kOptionName_40, "parse_func");
|
1111 | GLOBAL_STR(kOptionName_41, "parse_brace");
|
1112 | GLOBAL_STR(kOptionName_42, "parse_bracket");
|
1113 | GLOBAL_STR(kOptionName_43, "parse_equals");
|
1114 | GLOBAL_STR(kOptionName_44, "parse_paren");
|
1115 | GLOBAL_STR(kOptionName_45, "parse_ysh_string");
|
1116 | GLOBAL_STR(kOptionName_46, "parse_triple_quote");
|
1117 | GLOBAL_STR(kOptionName_47, "simple_word_eval");
|
1118 | GLOBAL_STR(kOptionName_48, "dashglob");
|
1119 | GLOBAL_STR(kOptionName_49, "command_sub_errexit");
|
1120 | GLOBAL_STR(kOptionName_50, "process_sub_fail");
|
1121 | GLOBAL_STR(kOptionName_51, "xtrace_rich");
|
1122 | GLOBAL_STR(kOptionName_52, "xtrace_details");
|
1123 | GLOBAL_STR(kOptionName_53, "sigpipe_status_ok");
|
1124 | GLOBAL_STR(kOptionName_54, "redefine_proc_func");
|
1125 | GLOBAL_STR(kOptionName_55, "parse_at_all");
|
1126 | GLOBAL_STR(kOptionName_56, "parse_backslash");
|
1127 | GLOBAL_STR(kOptionName_57, "parse_backticks");
|
1128 | GLOBAL_STR(kOptionName_58, "parse_dollar");
|
1129 | GLOBAL_STR(kOptionName_59, "parse_ignored");
|
1130 | GLOBAL_STR(kOptionName_60, "parse_sh_arith");
|
1131 | GLOBAL_STR(kOptionName_61, "parse_dparen");
|
1132 | GLOBAL_STR(kOptionName_62, "parse_dbracket");
|
1133 | GLOBAL_STR(kOptionName_63, "parse_bare_word");
|
1134 | GLOBAL_STR(kOptionName_64, "simple_echo");
|
1135 | GLOBAL_STR(kOptionName_65, "simple_eval_builtin");
|
1136 | GLOBAL_STR(kOptionName_66, "simple_test_builtin");
|
1137 | GLOBAL_STR(kOptionName_67, "expand_aliases");
|
1138 | GLOBAL_STR(kOptionName_68, "lastpipe");
|
1139 | GLOBAL_STR(kOptionName_69, "progcomp");
|
1140 | GLOBAL_STR(kOptionName_70, "histappend");
|
1141 | GLOBAL_STR(kOptionName_71, "hostcomplete");
|
1142 | GLOBAL_STR(kOptionName_72, "cmdhist");
|
1143 | GLOBAL_STR(kOptionName_73, "assoc_expand_once");
|
1144 | GLOBAL_STR(kOptionName_74, "autocd");
|
1145 | GLOBAL_STR(kOptionName_75, "cdable_vars");
|
1146 | GLOBAL_STR(kOptionName_76, "cdspell");
|
1147 | GLOBAL_STR(kOptionName_77, "checkhash");
|
1148 | GLOBAL_STR(kOptionName_78, "checkjobs");
|
1149 | GLOBAL_STR(kOptionName_79, "checkwinsize");
|
1150 | GLOBAL_STR(kOptionName_80, "complete_fullquote");
|
1151 | GLOBAL_STR(kOptionName_81, "direxpand");
|
1152 | GLOBAL_STR(kOptionName_82, "dirspell");
|
1153 | GLOBAL_STR(kOptionName_83, "dotglob");
|
1154 | GLOBAL_STR(kOptionName_84, "execfail");
|
1155 | GLOBAL_STR(kOptionName_85, "extdebug");
|
1156 | GLOBAL_STR(kOptionName_86, "extquote");
|
1157 | GLOBAL_STR(kOptionName_87, "force_fignore");
|
1158 | GLOBAL_STR(kOptionName_88, "globasciiranges");
|
1159 | GLOBAL_STR(kOptionName_89, "globstar");
|
1160 | GLOBAL_STR(kOptionName_90, "gnu_errfmt");
|
1161 | GLOBAL_STR(kOptionName_91, "histreedit");
|
1162 | GLOBAL_STR(kOptionName_92, "histverify");
|
1163 | GLOBAL_STR(kOptionName_93, "huponexit");
|
1164 | GLOBAL_STR(kOptionName_94, "interactive_comments");
|
1165 | GLOBAL_STR(kOptionName_95, "lithist");
|
1166 | GLOBAL_STR(kOptionName_96, "localvar_inherit");
|
1167 | GLOBAL_STR(kOptionName_97, "localvar_unset");
|
1168 | GLOBAL_STR(kOptionName_98, "login_shell");
|
1169 | GLOBAL_STR(kOptionName_99, "mailwarn");
|
1170 | GLOBAL_STR(kOptionName_100, "no_empty_cmd_completion");
|
1171 | GLOBAL_STR(kOptionName_101, "nocaseglob");
|
1172 | GLOBAL_STR(kOptionName_102, "progcomp_alias");
|
1173 | GLOBAL_STR(kOptionName_103, "promptvars");
|
1174 | GLOBAL_STR(kOptionName_104, "restricted_shell");
|
1175 | GLOBAL_STR(kOptionName_105, "shift_verbose");
|
1176 | GLOBAL_STR(kOptionName_106, "sourcepath");
|
1177 | GLOBAL_STR(kOptionName_107, "xpg_echo");
|
1178 |
|
1179 | BigStr* OptionName(int i) {
|
1180 | switch (i) {
|
1181 | case 1:
|
1182 | return kOptionName_1;
|
1183 | break;
|
1184 | case 2:
|
1185 | return kOptionName_2;
|
1186 | break;
|
1187 | case 3:
|
1188 | return kOptionName_3;
|
1189 | break;
|
1190 | case 4:
|
1191 | return kOptionName_4;
|
1192 | break;
|
1193 | case 5:
|
1194 | return kOptionName_5;
|
1195 | break;
|
1196 | case 6:
|
1197 | return kOptionName_6;
|
1198 | break;
|
1199 | case 7:
|
1200 | return kOptionName_7;
|
1201 | break;
|
1202 | case 8:
|
1203 | return kOptionName_8;
|
1204 | break;
|
1205 | case 9:
|
1206 | return kOptionName_9;
|
1207 | break;
|
1208 | case 10:
|
1209 | return kOptionName_10;
|
1210 | break;
|
1211 | case 11:
|
1212 | return kOptionName_11;
|
1213 | break;
|
1214 | case 12:
|
1215 | return kOptionName_12;
|
1216 | break;
|
1217 | case 13:
|
1218 | return kOptionName_13;
|
1219 | break;
|
1220 | case 14:
|
1221 | return kOptionName_14;
|
1222 | break;
|
1223 | case 15:
|
1224 | return kOptionName_15;
|
1225 | break;
|
1226 | case 16:
|
1227 | return kOptionName_16;
|
1228 | break;
|
1229 | case 17:
|
1230 | return kOptionName_17;
|
1231 | break;
|
1232 | case 18:
|
1233 | return kOptionName_18;
|
1234 | break;
|
1235 | case 19:
|
1236 | return kOptionName_19;
|
1237 | break;
|
1238 | case 20:
|
1239 | return kOptionName_20;
|
1240 | break;
|
1241 | case 21:
|
1242 | return kOptionName_21;
|
1243 | break;
|
1244 | case 22:
|
1245 | return kOptionName_22;
|
1246 | break;
|
1247 | case 23:
|
1248 | return kOptionName_23;
|
1249 | break;
|
1250 | case 24:
|
1251 | return kOptionName_24;
|
1252 | break;
|
1253 | case 25:
|
1254 | return kOptionName_25;
|
1255 | break;
|
1256 | case 26:
|
1257 | return kOptionName_26;
|
1258 | break;
|
1259 | case 27:
|
1260 | return kOptionName_27;
|
1261 | break;
|
1262 | case 28:
|
1263 | return kOptionName_28;
|
1264 | break;
|
1265 | case 29:
|
1266 | return kOptionName_29;
|
1267 | break;
|
1268 | case 30:
|
1269 | return kOptionName_30;
|
1270 | break;
|
1271 | case 31:
|
1272 | return kOptionName_31;
|
1273 | break;
|
1274 | case 32:
|
1275 | return kOptionName_32;
|
1276 | break;
|
1277 | case 33:
|
1278 | return kOptionName_33;
|
1279 | break;
|
1280 | case 34:
|
1281 | return kOptionName_34;
|
1282 | break;
|
1283 | case 35:
|
1284 | return kOptionName_35;
|
1285 | break;
|
1286 | case 36:
|
1287 | return kOptionName_36;
|
1288 | break;
|
1289 | case 37:
|
1290 | return kOptionName_37;
|
1291 | break;
|
1292 | case 38:
|
1293 | return kOptionName_38;
|
1294 | break;
|
1295 | case 39:
|
1296 | return kOptionName_39;
|
1297 | break;
|
1298 | case 40:
|
1299 | return kOptionName_40;
|
1300 | break;
|
1301 | case 41:
|
1302 | return kOptionName_41;
|
1303 | break;
|
1304 | case 42:
|
1305 | return kOptionName_42;
|
1306 | break;
|
1307 | case 43:
|
1308 | return kOptionName_43;
|
1309 | break;
|
1310 | case 44:
|
1311 | return kOptionName_44;
|
1312 | break;
|
1313 | case 45:
|
1314 | return kOptionName_45;
|
1315 | break;
|
1316 | case 46:
|
1317 | return kOptionName_46;
|
1318 | break;
|
1319 | case 47:
|
1320 | return kOptionName_47;
|
1321 | break;
|
1322 | case 48:
|
1323 | return kOptionName_48;
|
1324 | break;
|
1325 | case 49:
|
1326 | return kOptionName_49;
|
1327 | break;
|
1328 | case 50:
|
1329 | return kOptionName_50;
|
1330 | break;
|
1331 | case 51:
|
1332 | return kOptionName_51;
|
1333 | break;
|
1334 | case 52:
|
1335 | return kOptionName_52;
|
1336 | break;
|
1337 | case 53:
|
1338 | return kOptionName_53;
|
1339 | break;
|
1340 | case 54:
|
1341 | return kOptionName_54;
|
1342 | break;
|
1343 | case 55:
|
1344 | return kOptionName_55;
|
1345 | break;
|
1346 | case 56:
|
1347 | return kOptionName_56;
|
1348 | break;
|
1349 | case 57:
|
1350 | return kOptionName_57;
|
1351 | break;
|
1352 | case 58:
|
1353 | return kOptionName_58;
|
1354 | break;
|
1355 | case 59:
|
1356 | return kOptionName_59;
|
1357 | break;
|
1358 | case 60:
|
1359 | return kOptionName_60;
|
1360 | break;
|
1361 | case 61:
|
1362 | return kOptionName_61;
|
1363 | break;
|
1364 | case 62:
|
1365 | return kOptionName_62;
|
1366 | break;
|
1367 | case 63:
|
1368 | return kOptionName_63;
|
1369 | break;
|
1370 | case 64:
|
1371 | return kOptionName_64;
|
1372 | break;
|
1373 | case 65:
|
1374 | return kOptionName_65;
|
1375 | break;
|
1376 | case 66:
|
1377 | return kOptionName_66;
|
1378 | break;
|
1379 | case 67:
|
1380 | return kOptionName_67;
|
1381 | break;
|
1382 | case 68:
|
1383 | return kOptionName_68;
|
1384 | break;
|
1385 | case 69:
|
1386 | return kOptionName_69;
|
1387 | break;
|
1388 | case 70:
|
1389 | return kOptionName_70;
|
1390 | break;
|
1391 | case 71:
|
1392 | return kOptionName_71;
|
1393 | break;
|
1394 | case 72:
|
1395 | return kOptionName_72;
|
1396 | break;
|
1397 | case 73:
|
1398 | return kOptionName_73;
|
1399 | break;
|
1400 | case 74:
|
1401 | return kOptionName_74;
|
1402 | break;
|
1403 | case 75:
|
1404 | return kOptionName_75;
|
1405 | break;
|
1406 | case 76:
|
1407 | return kOptionName_76;
|
1408 | break;
|
1409 | case 77:
|
1410 | return kOptionName_77;
|
1411 | break;
|
1412 | case 78:
|
1413 | return kOptionName_78;
|
1414 | break;
|
1415 | case 79:
|
1416 | return kOptionName_79;
|
1417 | break;
|
1418 | case 80:
|
1419 | return kOptionName_80;
|
1420 | break;
|
1421 | case 81:
|
1422 | return kOptionName_81;
|
1423 | break;
|
1424 | case 82:
|
1425 | return kOptionName_82;
|
1426 | break;
|
1427 | case 83:
|
1428 | return kOptionName_83;
|
1429 | break;
|
1430 | case 84:
|
1431 | return kOptionName_84;
|
1432 | break;
|
1433 | case 85:
|
1434 | return kOptionName_85;
|
1435 | break;
|
1436 | case 86:
|
1437 | return kOptionName_86;
|
1438 | break;
|
1439 | case 87:
|
1440 | return kOptionName_87;
|
1441 | break;
|
1442 | case 88:
|
1443 | return kOptionName_88;
|
1444 | break;
|
1445 | case 89:
|
1446 | return kOptionName_89;
|
1447 | break;
|
1448 | case 90:
|
1449 | return kOptionName_90;
|
1450 | break;
|
1451 | case 91:
|
1452 | return kOptionName_91;
|
1453 | break;
|
1454 | case 92:
|
1455 | return kOptionName_92;
|
1456 | break;
|
1457 | case 93:
|
1458 | return kOptionName_93;
|
1459 | break;
|
1460 | case 94:
|
1461 | return kOptionName_94;
|
1462 | break;
|
1463 | case 95:
|
1464 | return kOptionName_95;
|
1465 | break;
|
1466 | case 96:
|
1467 | return kOptionName_96;
|
1468 | break;
|
1469 | case 97:
|
1470 | return kOptionName_97;
|
1471 | break;
|
1472 | case 98:
|
1473 | return kOptionName_98;
|
1474 | break;
|
1475 | case 99:
|
1476 | return kOptionName_99;
|
1477 | break;
|
1478 | case 100:
|
1479 | return kOptionName_100;
|
1480 | break;
|
1481 | case 101:
|
1482 | return kOptionName_101;
|
1483 | break;
|
1484 | case 102:
|
1485 | return kOptionName_102;
|
1486 | break;
|
1487 | case 103:
|
1488 | return kOptionName_103;
|
1489 | break;
|
1490 | case 104:
|
1491 | return kOptionName_104;
|
1492 | break;
|
1493 | case 105:
|
1494 | return kOptionName_105;
|
1495 | break;
|
1496 | case 106:
|
1497 | return kOptionName_106;
|
1498 | break;
|
1499 | case 107:
|
1500 | return kOptionName_107;
|
1501 | break;
|
1502 | default:
|
1503 | FAIL(kShouldNotGetHere);
|
1504 | }
|
1505 | }
|
1506 |
|
1507 | int _IFS_EDGE[8][6] = {
|
1508 | { -1, -1, -1, -1, -1, -1 },
|
1509 | { -1, -1, -1, -1, -1, -1 },
|
1510 | { -1, (1<<16)|5, (4<<16)|3, (6<<16)|5, (7<<16)|5, (8<<16)|5 },
|
1511 | { -1, (3<<16)|5, (4<<16)|5, (6<<16)|2, (7<<16)|2, (8<<16)|5 },
|
1512 | { -1, (5<<16)|5, (4<<16)|3, (6<<16)|2, (6<<16)|2, (8<<16)|2 },
|
1513 | { -1, (5<<16)|5, (4<<16)|3, (6<<16)|2, (7<<16)|2, (8<<16)|2 },
|
1514 | { -1, (3<<16)|1, (4<<16)|1, (6<<16)|5, (7<<16)|1, (8<<16)|1 },
|
1515 | { -1, (6<<16)|4, (6<<16)|4, (6<<16)|4, (6<<16)|4, (8<<16)|4 },
|
1516 |
|
1517 | };
|
1518 |
|
1519 | // Note: all of these are integers, e.g. state_i, emit_i, char_kind_i
|
1520 | using runtime_asdl::state_t;
|
1521 | using runtime_asdl::emit_t;
|
1522 | using runtime_asdl::char_kind_t;
|
1523 |
|
1524 | Tuple2<state_t, emit_t> IfsEdge(state_t state, runtime_asdl::char_kind_t ch) {
|
1525 | int cell = _IFS_EDGE[state][ch];
|
1526 | state_t new_state = cell >> 16;
|
1527 | emit_t emit = cell & 0xFFFF;
|
1528 | return Tuple2<state_t, emit_t>(new_state, emit);
|
1529 | }
|
1530 |
|
1531 | GLOBAL_STR(kBUILTIN_NAMES_0, ":");
|
1532 | GLOBAL_STR(kBUILTIN_NAMES_1, ".");
|
1533 | GLOBAL_STR(kBUILTIN_NAMES_2, "exec");
|
1534 | GLOBAL_STR(kBUILTIN_NAMES_3, "eval");
|
1535 | GLOBAL_STR(kBUILTIN_NAMES_4, "set");
|
1536 | GLOBAL_STR(kBUILTIN_NAMES_5, "shift");
|
1537 | GLOBAL_STR(kBUILTIN_NAMES_6, "times");
|
1538 | GLOBAL_STR(kBUILTIN_NAMES_7, "trap");
|
1539 | GLOBAL_STR(kBUILTIN_NAMES_8, "unset");
|
1540 | GLOBAL_STR(kBUILTIN_NAMES_9, "builtin");
|
1541 | GLOBAL_STR(kBUILTIN_NAMES_10, "readonly");
|
1542 | GLOBAL_STR(kBUILTIN_NAMES_11, "local");
|
1543 | GLOBAL_STR(kBUILTIN_NAMES_12, "declare");
|
1544 | GLOBAL_STR(kBUILTIN_NAMES_13, "typeset");
|
1545 | GLOBAL_STR(kBUILTIN_NAMES_14, "export");
|
1546 | GLOBAL_STR(kBUILTIN_NAMES_15, "true");
|
1547 | GLOBAL_STR(kBUILTIN_NAMES_16, "false");
|
1548 | GLOBAL_STR(kBUILTIN_NAMES_17, "try");
|
1549 | GLOBAL_STR(kBUILTIN_NAMES_18, "read");
|
1550 | GLOBAL_STR(kBUILTIN_NAMES_19, "echo");
|
1551 | GLOBAL_STR(kBUILTIN_NAMES_20, "printf");
|
1552 | GLOBAL_STR(kBUILTIN_NAMES_21, "mapfile");
|
1553 | GLOBAL_STR(kBUILTIN_NAMES_22, "readarray");
|
1554 | GLOBAL_STR(kBUILTIN_NAMES_23, "cd");
|
1555 | GLOBAL_STR(kBUILTIN_NAMES_24, "pushd");
|
1556 | GLOBAL_STR(kBUILTIN_NAMES_25, "popd");
|
1557 | GLOBAL_STR(kBUILTIN_NAMES_26, "dirs");
|
1558 | GLOBAL_STR(kBUILTIN_NAMES_27, "pwd");
|
1559 | GLOBAL_STR(kBUILTIN_NAMES_28, "source");
|
1560 | GLOBAL_STR(kBUILTIN_NAMES_29, "umask");
|
1561 | GLOBAL_STR(kBUILTIN_NAMES_30, "ulimit");
|
1562 | GLOBAL_STR(kBUILTIN_NAMES_31, "wait");
|
1563 | GLOBAL_STR(kBUILTIN_NAMES_32, "jobs");
|
1564 | GLOBAL_STR(kBUILTIN_NAMES_33, "fg");
|
1565 | GLOBAL_STR(kBUILTIN_NAMES_34, "bg");
|
1566 | GLOBAL_STR(kBUILTIN_NAMES_35, "shopt");
|
1567 | GLOBAL_STR(kBUILTIN_NAMES_36, "complete");
|
1568 | GLOBAL_STR(kBUILTIN_NAMES_37, "compgen");
|
1569 | GLOBAL_STR(kBUILTIN_NAMES_38, "compopt");
|
1570 | GLOBAL_STR(kBUILTIN_NAMES_39, "compadjust");
|
1571 | GLOBAL_STR(kBUILTIN_NAMES_40, "compexport");
|
1572 | GLOBAL_STR(kBUILTIN_NAMES_41, "getopts");
|
1573 | GLOBAL_STR(kBUILTIN_NAMES_42, "command");
|
1574 | GLOBAL_STR(kBUILTIN_NAMES_43, "type");
|
1575 | GLOBAL_STR(kBUILTIN_NAMES_44, "hash");
|
1576 | GLOBAL_STR(kBUILTIN_NAMES_45, "help");
|
1577 | GLOBAL_STR(kBUILTIN_NAMES_46, "history");
|
1578 | GLOBAL_STR(kBUILTIN_NAMES_47, "alias");
|
1579 | GLOBAL_STR(kBUILTIN_NAMES_48, "unalias");
|
1580 | GLOBAL_STR(kBUILTIN_NAMES_49, "bind");
|
1581 | GLOBAL_STR(kBUILTIN_NAMES_50, "append");
|
1582 | GLOBAL_STR(kBUILTIN_NAMES_51, "write");
|
1583 | GLOBAL_STR(kBUILTIN_NAMES_52, "json");
|
1584 | GLOBAL_STR(kBUILTIN_NAMES_53, "json8");
|
1585 | GLOBAL_STR(kBUILTIN_NAMES_54, "pp");
|
1586 | GLOBAL_STR(kBUILTIN_NAMES_55, "hay");
|
1587 | GLOBAL_STR(kBUILTIN_NAMES_56, "haynode");
|
1588 | GLOBAL_STR(kBUILTIN_NAMES_57, "module");
|
1589 | GLOBAL_STR(kBUILTIN_NAMES_58, "use");
|
1590 | GLOBAL_STR(kBUILTIN_NAMES_59, "error");
|
1591 | GLOBAL_STR(kBUILTIN_NAMES_60, "failed");
|
1592 | GLOBAL_STR(kBUILTIN_NAMES_61, "fork");
|
1593 | GLOBAL_STR(kBUILTIN_NAMES_62, "forkwait");
|
1594 | GLOBAL_STR(kBUILTIN_NAMES_63, "fopen");
|
1595 | GLOBAL_STR(kBUILTIN_NAMES_64, "shvar");
|
1596 | GLOBAL_STR(kBUILTIN_NAMES_65, "ctx");
|
1597 | GLOBAL_STR(kBUILTIN_NAMES_66, "runproc");
|
1598 | GLOBAL_STR(kBUILTIN_NAMES_67, "boolstatus");
|
1599 | GLOBAL_STR(kBUILTIN_NAMES_68, "test");
|
1600 | GLOBAL_STR(kBUILTIN_NAMES_69, "[");
|
1601 | GLOBAL_STR(kBUILTIN_NAMES_70, "push-registers");
|
1602 | GLOBAL_STR(kBUILTIN_NAMES_71, "is-main");
|
1603 | GLOBAL_STR(kBUILTIN_NAMES_72, "__cat");
|
1604 | GLOBAL_LIST(BUILTIN_NAMES, BigStr*, 73, {kBUILTIN_NAMES_0 COMMA kBUILTIN_NAMES_1 COMMA kBUILTIN_NAMES_2 COMMA kBUILTIN_NAMES_3 COMMA kBUILTIN_NAMES_4 COMMA kBUILTIN_NAMES_5 COMMA kBUILTIN_NAMES_6 COMMA kBUILTIN_NAMES_7 COMMA kBUILTIN_NAMES_8 COMMA kBUILTIN_NAMES_9 COMMA kBUILTIN_NAMES_10 COMMA kBUILTIN_NAMES_11 COMMA kBUILTIN_NAMES_12 COMMA kBUILTIN_NAMES_13 COMMA kBUILTIN_NAMES_14 COMMA kBUILTIN_NAMES_15 COMMA kBUILTIN_NAMES_16 COMMA kBUILTIN_NAMES_17 COMMA kBUILTIN_NAMES_18 COMMA kBUILTIN_NAMES_19 COMMA kBUILTIN_NAMES_20 COMMA kBUILTIN_NAMES_21 COMMA kBUILTIN_NAMES_22 COMMA kBUILTIN_NAMES_23 COMMA kBUILTIN_NAMES_24 COMMA kBUILTIN_NAMES_25 COMMA kBUILTIN_NAMES_26 COMMA kBUILTIN_NAMES_27 COMMA kBUILTIN_NAMES_28 COMMA kBUILTIN_NAMES_29 COMMA kBUILTIN_NAMES_30 COMMA kBUILTIN_NAMES_31 COMMA kBUILTIN_NAMES_32 COMMA kBUILTIN_NAMES_33 COMMA kBUILTIN_NAMES_34 COMMA kBUILTIN_NAMES_35 COMMA kBUILTIN_NAMES_36 COMMA kBUILTIN_NAMES_37 COMMA kBUILTIN_NAMES_38 COMMA kBUILTIN_NAMES_39 COMMA kBUILTIN_NAMES_40 COMMA kBUILTIN_NAMES_41 COMMA kBUILTIN_NAMES_42 COMMA kBUILTIN_NAMES_43 COMMA kBUILTIN_NAMES_44 COMMA kBUILTIN_NAMES_45 COMMA kBUILTIN_NAMES_46 COMMA kBUILTIN_NAMES_47 COMMA kBUILTIN_NAMES_48 COMMA kBUILTIN_NAMES_49 COMMA kBUILTIN_NAMES_50 COMMA kBUILTIN_NAMES_51 COMMA kBUILTIN_NAMES_52 COMMA kBUILTIN_NAMES_53 COMMA kBUILTIN_NAMES_54 COMMA kBUILTIN_NAMES_55 COMMA kBUILTIN_NAMES_56 COMMA kBUILTIN_NAMES_57 COMMA kBUILTIN_NAMES_58 COMMA kBUILTIN_NAMES_59 COMMA kBUILTIN_NAMES_60 COMMA kBUILTIN_NAMES_61 COMMA kBUILTIN_NAMES_62 COMMA kBUILTIN_NAMES_63 COMMA kBUILTIN_NAMES_64 COMMA kBUILTIN_NAMES_65 COMMA kBUILTIN_NAMES_66 COMMA kBUILTIN_NAMES_67 COMMA kBUILTIN_NAMES_68 COMMA kBUILTIN_NAMES_69 COMMA kBUILTIN_NAMES_70 COMMA kBUILTIN_NAMES_71 COMMA kBUILTIN_NAMES_72});
|
1605 |
|
1606 | GLOBAL_STR(kOSH_KEYWORD_NAMES_0, "[[");
|
1607 | GLOBAL_STR(kOSH_KEYWORD_NAMES_1, "!");
|
1608 | GLOBAL_STR(kOSH_KEYWORD_NAMES_2, "for");
|
1609 | GLOBAL_STR(kOSH_KEYWORD_NAMES_3, "while");
|
1610 | GLOBAL_STR(kOSH_KEYWORD_NAMES_4, "until");
|
1611 | GLOBAL_STR(kOSH_KEYWORD_NAMES_5, "do");
|
1612 | GLOBAL_STR(kOSH_KEYWORD_NAMES_6, "done");
|
1613 | GLOBAL_STR(kOSH_KEYWORD_NAMES_7, "in");
|
1614 | GLOBAL_STR(kOSH_KEYWORD_NAMES_8, "case");
|
1615 | GLOBAL_STR(kOSH_KEYWORD_NAMES_9, "esac");
|
1616 | GLOBAL_STR(kOSH_KEYWORD_NAMES_10, "if");
|
1617 | GLOBAL_STR(kOSH_KEYWORD_NAMES_11, "fi");
|
1618 | GLOBAL_STR(kOSH_KEYWORD_NAMES_12, "then");
|
1619 | GLOBAL_STR(kOSH_KEYWORD_NAMES_13, "else");
|
1620 | GLOBAL_STR(kOSH_KEYWORD_NAMES_14, "elif");
|
1621 | GLOBAL_STR(kOSH_KEYWORD_NAMES_15, "function");
|
1622 | GLOBAL_STR(kOSH_KEYWORD_NAMES_16, "time");
|
1623 | GLOBAL_STR(kOSH_KEYWORD_NAMES_17, "const");
|
1624 | GLOBAL_STR(kOSH_KEYWORD_NAMES_18, "var");
|
1625 | GLOBAL_STR(kOSH_KEYWORD_NAMES_19, "setvar");
|
1626 | GLOBAL_STR(kOSH_KEYWORD_NAMES_20, "setglobal");
|
1627 | GLOBAL_STR(kOSH_KEYWORD_NAMES_21, "call");
|
1628 | GLOBAL_STR(kOSH_KEYWORD_NAMES_22, "proc");
|
1629 | GLOBAL_STR(kOSH_KEYWORD_NAMES_23, "typed");
|
1630 | GLOBAL_STR(kOSH_KEYWORD_NAMES_24, "func");
|
1631 | GLOBAL_STR(kOSH_KEYWORD_NAMES_25, "{");
|
1632 | GLOBAL_STR(kOSH_KEYWORD_NAMES_26, "=");
|
1633 | GLOBAL_STR(kOSH_KEYWORD_NAMES_27, "}");
|
1634 | GLOBAL_STR(kOSH_KEYWORD_NAMES_28, "]]");
|
1635 | GLOBAL_LIST(OSH_KEYWORD_NAMES, BigStr*, 29, {kOSH_KEYWORD_NAMES_0 COMMA kOSH_KEYWORD_NAMES_1 COMMA kOSH_KEYWORD_NAMES_2 COMMA kOSH_KEYWORD_NAMES_3 COMMA kOSH_KEYWORD_NAMES_4 COMMA kOSH_KEYWORD_NAMES_5 COMMA kOSH_KEYWORD_NAMES_6 COMMA kOSH_KEYWORD_NAMES_7 COMMA kOSH_KEYWORD_NAMES_8 COMMA kOSH_KEYWORD_NAMES_9 COMMA kOSH_KEYWORD_NAMES_10 COMMA kOSH_KEYWORD_NAMES_11 COMMA kOSH_KEYWORD_NAMES_12 COMMA kOSH_KEYWORD_NAMES_13 COMMA kOSH_KEYWORD_NAMES_14 COMMA kOSH_KEYWORD_NAMES_15 COMMA kOSH_KEYWORD_NAMES_16 COMMA kOSH_KEYWORD_NAMES_17 COMMA kOSH_KEYWORD_NAMES_18 COMMA kOSH_KEYWORD_NAMES_19 COMMA kOSH_KEYWORD_NAMES_20 COMMA kOSH_KEYWORD_NAMES_21 COMMA kOSH_KEYWORD_NAMES_22 COMMA kOSH_KEYWORD_NAMES_23 COMMA kOSH_KEYWORD_NAMES_24 COMMA kOSH_KEYWORD_NAMES_25 COMMA kOSH_KEYWORD_NAMES_26 COMMA kOSH_KEYWORD_NAMES_27 COMMA kOSH_KEYWORD_NAMES_28});
|
1636 |
|
1637 | GLOBAL_STR(kSET_OPTION_NAMES_0, "emacs");
|
1638 | GLOBAL_STR(kSET_OPTION_NAMES_1, "errexit");
|
1639 | GLOBAL_STR(kSET_OPTION_NAMES_2, "hashall");
|
1640 | GLOBAL_STR(kSET_OPTION_NAMES_3, "noclobber");
|
1641 | GLOBAL_STR(kSET_OPTION_NAMES_4, "noexec");
|
1642 | GLOBAL_STR(kSET_OPTION_NAMES_5, "noglob");
|
1643 | GLOBAL_STR(kSET_OPTION_NAMES_6, "nounset");
|
1644 | GLOBAL_STR(kSET_OPTION_NAMES_7, "pipefail");
|
1645 | GLOBAL_STR(kSET_OPTION_NAMES_8, "posix");
|
1646 | GLOBAL_STR(kSET_OPTION_NAMES_9, "verbose");
|
1647 | GLOBAL_STR(kSET_OPTION_NAMES_10, "vi");
|
1648 | GLOBAL_STR(kSET_OPTION_NAMES_11, "xtrace");
|
1649 | GLOBAL_LIST(SET_OPTION_NAMES, BigStr*, 12, {kSET_OPTION_NAMES_0 COMMA kSET_OPTION_NAMES_1 COMMA kSET_OPTION_NAMES_2 COMMA kSET_OPTION_NAMES_3 COMMA kSET_OPTION_NAMES_4 COMMA kSET_OPTION_NAMES_5 COMMA kSET_OPTION_NAMES_6 COMMA kSET_OPTION_NAMES_7 COMMA kSET_OPTION_NAMES_8 COMMA kSET_OPTION_NAMES_9 COMMA kSET_OPTION_NAMES_10 COMMA kSET_OPTION_NAMES_11});
|
1650 |
|
1651 | GLOBAL_STR(kSHOPT_OPTION_NAMES_0, "_allow_command_sub");
|
1652 | GLOBAL_STR(kSHOPT_OPTION_NAMES_1, "_allow_process_sub");
|
1653 | GLOBAL_STR(kSHOPT_OPTION_NAMES_2, "_no_debug_trap");
|
1654 | GLOBAL_STR(kSHOPT_OPTION_NAMES_3, "_no_err_trap");
|
1655 | GLOBAL_STR(kSHOPT_OPTION_NAMES_4, "_running_hay");
|
1656 | GLOBAL_STR(kSHOPT_OPTION_NAMES_5, "_running_trap");
|
1657 | GLOBAL_STR(kSHOPT_OPTION_NAMES_6, "assoc_expand_once");
|
1658 | GLOBAL_STR(kSHOPT_OPTION_NAMES_7, "autocd");
|
1659 | GLOBAL_STR(kSHOPT_OPTION_NAMES_8, "cdable_vars");
|
1660 | GLOBAL_STR(kSHOPT_OPTION_NAMES_9, "cdspell");
|
1661 | GLOBAL_STR(kSHOPT_OPTION_NAMES_10, "checkhash");
|
1662 | GLOBAL_STR(kSHOPT_OPTION_NAMES_11, "checkjobs");
|
1663 | GLOBAL_STR(kSHOPT_OPTION_NAMES_12, "checkwinsize");
|
1664 | GLOBAL_STR(kSHOPT_OPTION_NAMES_13, "cmdhist");
|
1665 | GLOBAL_STR(kSHOPT_OPTION_NAMES_14, "command_sub_errexit");
|
1666 | GLOBAL_STR(kSHOPT_OPTION_NAMES_15, "complete_fullquote");
|
1667 | GLOBAL_STR(kSHOPT_OPTION_NAMES_16, "dashglob");
|
1668 | GLOBAL_STR(kSHOPT_OPTION_NAMES_17, "direxpand");
|
1669 | GLOBAL_STR(kSHOPT_OPTION_NAMES_18, "dirspell");
|
1670 | GLOBAL_STR(kSHOPT_OPTION_NAMES_19, "dotglob");
|
1671 | GLOBAL_STR(kSHOPT_OPTION_NAMES_20, "dynamic_scope");
|
1672 | GLOBAL_STR(kSHOPT_OPTION_NAMES_21, "eval_unsafe_arith");
|
1673 | GLOBAL_STR(kSHOPT_OPTION_NAMES_22, "execfail");
|
1674 | GLOBAL_STR(kSHOPT_OPTION_NAMES_23, "expand_aliases");
|
1675 | GLOBAL_STR(kSHOPT_OPTION_NAMES_24, "extdebug");
|
1676 | GLOBAL_STR(kSHOPT_OPTION_NAMES_25, "extglob");
|
1677 | GLOBAL_STR(kSHOPT_OPTION_NAMES_26, "extquote");
|
1678 | GLOBAL_STR(kSHOPT_OPTION_NAMES_27, "failglob");
|
1679 | GLOBAL_STR(kSHOPT_OPTION_NAMES_28, "force_fignore");
|
1680 | GLOBAL_STR(kSHOPT_OPTION_NAMES_29, "globasciiranges");
|
1681 | GLOBAL_STR(kSHOPT_OPTION_NAMES_30, "globstar");
|
1682 | GLOBAL_STR(kSHOPT_OPTION_NAMES_31, "gnu_errfmt");
|
1683 | GLOBAL_STR(kSHOPT_OPTION_NAMES_32, "histappend");
|
1684 | GLOBAL_STR(kSHOPT_OPTION_NAMES_33, "histreedit");
|
1685 | GLOBAL_STR(kSHOPT_OPTION_NAMES_34, "histverify");
|
1686 | GLOBAL_STR(kSHOPT_OPTION_NAMES_35, "hostcomplete");
|
1687 | GLOBAL_STR(kSHOPT_OPTION_NAMES_36, "huponexit");
|
1688 | GLOBAL_STR(kSHOPT_OPTION_NAMES_37, "inherit_errexit");
|
1689 | GLOBAL_STR(kSHOPT_OPTION_NAMES_38, "interactive_comments");
|
1690 | GLOBAL_STR(kSHOPT_OPTION_NAMES_39, "lastpipe");
|
1691 | GLOBAL_STR(kSHOPT_OPTION_NAMES_40, "lithist");
|
1692 | GLOBAL_STR(kSHOPT_OPTION_NAMES_41, "localvar_inherit");
|
1693 | GLOBAL_STR(kSHOPT_OPTION_NAMES_42, "localvar_unset");
|
1694 | GLOBAL_STR(kSHOPT_OPTION_NAMES_43, "login_shell");
|
1695 | GLOBAL_STR(kSHOPT_OPTION_NAMES_44, "mailwarn");
|
1696 | GLOBAL_STR(kSHOPT_OPTION_NAMES_45, "no_empty_cmd_completion");
|
1697 | GLOBAL_STR(kSHOPT_OPTION_NAMES_46, "nocaseglob");
|
1698 | GLOBAL_STR(kSHOPT_OPTION_NAMES_47, "nocasematch");
|
1699 | GLOBAL_STR(kSHOPT_OPTION_NAMES_48, "nullglob");
|
1700 | GLOBAL_STR(kSHOPT_OPTION_NAMES_49, "parse_at");
|
1701 | GLOBAL_STR(kSHOPT_OPTION_NAMES_50, "parse_at_all");
|
1702 | GLOBAL_STR(kSHOPT_OPTION_NAMES_51, "parse_backslash");
|
1703 | GLOBAL_STR(kSHOPT_OPTION_NAMES_52, "parse_backticks");
|
1704 | GLOBAL_STR(kSHOPT_OPTION_NAMES_53, "parse_bare_word");
|
1705 | GLOBAL_STR(kSHOPT_OPTION_NAMES_54, "parse_brace");
|
1706 | GLOBAL_STR(kSHOPT_OPTION_NAMES_55, "parse_bracket");
|
1707 | GLOBAL_STR(kSHOPT_OPTION_NAMES_56, "parse_dbracket");
|
1708 | GLOBAL_STR(kSHOPT_OPTION_NAMES_57, "parse_dollar");
|
1709 | GLOBAL_STR(kSHOPT_OPTION_NAMES_58, "parse_dparen");
|
1710 | GLOBAL_STR(kSHOPT_OPTION_NAMES_59, "parse_equals");
|
1711 | GLOBAL_STR(kSHOPT_OPTION_NAMES_60, "parse_func");
|
1712 | GLOBAL_STR(kSHOPT_OPTION_NAMES_61, "parse_ignored");
|
1713 | GLOBAL_STR(kSHOPT_OPTION_NAMES_62, "parse_paren");
|
1714 | GLOBAL_STR(kSHOPT_OPTION_NAMES_63, "parse_proc");
|
1715 | GLOBAL_STR(kSHOPT_OPTION_NAMES_64, "parse_sh_arith");
|
1716 | GLOBAL_STR(kSHOPT_OPTION_NAMES_65, "parse_triple_quote");
|
1717 | GLOBAL_STR(kSHOPT_OPTION_NAMES_66, "parse_ysh_string");
|
1718 | GLOBAL_STR(kSHOPT_OPTION_NAMES_67, "process_sub_fail");
|
1719 | GLOBAL_STR(kSHOPT_OPTION_NAMES_68, "progcomp");
|
1720 | GLOBAL_STR(kSHOPT_OPTION_NAMES_69, "progcomp_alias");
|
1721 | GLOBAL_STR(kSHOPT_OPTION_NAMES_70, "promptvars");
|
1722 | GLOBAL_STR(kSHOPT_OPTION_NAMES_71, "redefine_module");
|
1723 | GLOBAL_STR(kSHOPT_OPTION_NAMES_72, "redefine_proc_func");
|
1724 | GLOBAL_STR(kSHOPT_OPTION_NAMES_73, "restricted_shell");
|
1725 | GLOBAL_STR(kSHOPT_OPTION_NAMES_74, "shift_verbose");
|
1726 | GLOBAL_STR(kSHOPT_OPTION_NAMES_75, "sigpipe_status_ok");
|
1727 | GLOBAL_STR(kSHOPT_OPTION_NAMES_76, "simple_echo");
|
1728 | GLOBAL_STR(kSHOPT_OPTION_NAMES_77, "simple_eval_builtin");
|
1729 | GLOBAL_STR(kSHOPT_OPTION_NAMES_78, "simple_test_builtin");
|
1730 | GLOBAL_STR(kSHOPT_OPTION_NAMES_79, "simple_word_eval");
|
1731 | GLOBAL_STR(kSHOPT_OPTION_NAMES_80, "sourcepath");
|
1732 | GLOBAL_STR(kSHOPT_OPTION_NAMES_81, "strict_argv");
|
1733 | GLOBAL_STR(kSHOPT_OPTION_NAMES_82, "strict_arith");
|
1734 | GLOBAL_STR(kSHOPT_OPTION_NAMES_83, "strict_array");
|
1735 | GLOBAL_STR(kSHOPT_OPTION_NAMES_84, "strict_control_flow");
|
1736 | GLOBAL_STR(kSHOPT_OPTION_NAMES_85, "strict_errexit");
|
1737 | GLOBAL_STR(kSHOPT_OPTION_NAMES_86, "strict_glob");
|
1738 | GLOBAL_STR(kSHOPT_OPTION_NAMES_87, "strict_nameref");
|
1739 | GLOBAL_STR(kSHOPT_OPTION_NAMES_88, "strict_tilde");
|
1740 | GLOBAL_STR(kSHOPT_OPTION_NAMES_89, "strict_word_eval");
|
1741 | GLOBAL_STR(kSHOPT_OPTION_NAMES_90, "verbose_errexit");
|
1742 | GLOBAL_STR(kSHOPT_OPTION_NAMES_91, "xpg_echo");
|
1743 | GLOBAL_STR(kSHOPT_OPTION_NAMES_92, "xtrace_details");
|
1744 | GLOBAL_STR(kSHOPT_OPTION_NAMES_93, "xtrace_rich");
|
1745 | GLOBAL_LIST(SHOPT_OPTION_NAMES, BigStr*, 94, {kSHOPT_OPTION_NAMES_0 COMMA kSHOPT_OPTION_NAMES_1 COMMA kSHOPT_OPTION_NAMES_2 COMMA kSHOPT_OPTION_NAMES_3 COMMA kSHOPT_OPTION_NAMES_4 COMMA kSHOPT_OPTION_NAMES_5 COMMA kSHOPT_OPTION_NAMES_6 COMMA kSHOPT_OPTION_NAMES_7 COMMA kSHOPT_OPTION_NAMES_8 COMMA kSHOPT_OPTION_NAMES_9 COMMA kSHOPT_OPTION_NAMES_10 COMMA kSHOPT_OPTION_NAMES_11 COMMA kSHOPT_OPTION_NAMES_12 COMMA kSHOPT_OPTION_NAMES_13 COMMA kSHOPT_OPTION_NAMES_14 COMMA kSHOPT_OPTION_NAMES_15 COMMA kSHOPT_OPTION_NAMES_16 COMMA kSHOPT_OPTION_NAMES_17 COMMA kSHOPT_OPTION_NAMES_18 COMMA kSHOPT_OPTION_NAMES_19 COMMA kSHOPT_OPTION_NAMES_20 COMMA kSHOPT_OPTION_NAMES_21 COMMA kSHOPT_OPTION_NAMES_22 COMMA kSHOPT_OPTION_NAMES_23 COMMA kSHOPT_OPTION_NAMES_24 COMMA kSHOPT_OPTION_NAMES_25 COMMA kSHOPT_OPTION_NAMES_26 COMMA kSHOPT_OPTION_NAMES_27 COMMA kSHOPT_OPTION_NAMES_28 COMMA kSHOPT_OPTION_NAMES_29 COMMA kSHOPT_OPTION_NAMES_30 COMMA kSHOPT_OPTION_NAMES_31 COMMA kSHOPT_OPTION_NAMES_32 COMMA kSHOPT_OPTION_NAMES_33 COMMA kSHOPT_OPTION_NAMES_34 COMMA kSHOPT_OPTION_NAMES_35 COMMA kSHOPT_OPTION_NAMES_36 COMMA kSHOPT_OPTION_NAMES_37 COMMA kSHOPT_OPTION_NAMES_38 COMMA kSHOPT_OPTION_NAMES_39 COMMA kSHOPT_OPTION_NAMES_40 COMMA kSHOPT_OPTION_NAMES_41 COMMA kSHOPT_OPTION_NAMES_42 COMMA kSHOPT_OPTION_NAMES_43 COMMA kSHOPT_OPTION_NAMES_44 COMMA kSHOPT_OPTION_NAMES_45 COMMA kSHOPT_OPTION_NAMES_46 COMMA kSHOPT_OPTION_NAMES_47 COMMA kSHOPT_OPTION_NAMES_48 COMMA kSHOPT_OPTION_NAMES_49 COMMA kSHOPT_OPTION_NAMES_50 COMMA kSHOPT_OPTION_NAMES_51 COMMA kSHOPT_OPTION_NAMES_52 COMMA kSHOPT_OPTION_NAMES_53 COMMA kSHOPT_OPTION_NAMES_54 COMMA kSHOPT_OPTION_NAMES_55 COMMA kSHOPT_OPTION_NAMES_56 COMMA kSHOPT_OPTION_NAMES_57 COMMA kSHOPT_OPTION_NAMES_58 COMMA kSHOPT_OPTION_NAMES_59 COMMA kSHOPT_OPTION_NAMES_60 COMMA kSHOPT_OPTION_NAMES_61 COMMA kSHOPT_OPTION_NAMES_62 COMMA kSHOPT_OPTION_NAMES_63 COMMA kSHOPT_OPTION_NAMES_64 COMMA kSHOPT_OPTION_NAMES_65 COMMA kSHOPT_OPTION_NAMES_66 COMMA kSHOPT_OPTION_NAMES_67 COMMA kSHOPT_OPTION_NAMES_68 COMMA kSHOPT_OPTION_NAMES_69 COMMA kSHOPT_OPTION_NAMES_70 COMMA kSHOPT_OPTION_NAMES_71 COMMA kSHOPT_OPTION_NAMES_72 COMMA kSHOPT_OPTION_NAMES_73 COMMA kSHOPT_OPTION_NAMES_74 COMMA kSHOPT_OPTION_NAMES_75 COMMA kSHOPT_OPTION_NAMES_76 COMMA kSHOPT_OPTION_NAMES_77 COMMA kSHOPT_OPTION_NAMES_78 COMMA kSHOPT_OPTION_NAMES_79 COMMA kSHOPT_OPTION_NAMES_80 COMMA kSHOPT_OPTION_NAMES_81 COMMA kSHOPT_OPTION_NAMES_82 COMMA kSHOPT_OPTION_NAMES_83 COMMA kSHOPT_OPTION_NAMES_84 COMMA kSHOPT_OPTION_NAMES_85 COMMA kSHOPT_OPTION_NAMES_86 COMMA kSHOPT_OPTION_NAMES_87 COMMA kSHOPT_OPTION_NAMES_88 COMMA kSHOPT_OPTION_NAMES_89 COMMA kSHOPT_OPTION_NAMES_90 COMMA kSHOPT_OPTION_NAMES_91 COMMA kSHOPT_OPTION_NAMES_92 COMMA kSHOPT_OPTION_NAMES_93});
|
1746 |
|
1747 | } // namespace consts
|
1748 |
|