@@ -234,6 +234,179 @@ msgid ""
234234"end_col_offset)\n"
235235"}\n"
236236msgstr ""
237+ "-- ASDL's 4 builtin types are:\n"
238+ "-- identifier, int, string, constant\n"
239+ "\n"
240+ "module Python\n"
241+ "{\n"
242+ " mod = Module(stmt* body, type_ignore* type_ignores)\n"
243+ " | Interactive(stmt* body)\n"
244+ " | Expression(expr body)\n"
245+ " | FunctionType(expr* argtypes, expr returns)\n"
246+ "\n"
247+ " stmt = FunctionDef(identifier name, arguments args,\n"
248+ " stmt* body, expr* decorator_list, expr? returns,\n"
249+ " string? type_comment, type_param* type_params)\n"
250+ " | AsyncFunctionDef(identifier name, arguments args,\n"
251+ " stmt* body, expr* decorator_list, expr? "
252+ "returns,\n"
253+ " string? type_comment, type_param* type_params)\n"
254+ "\n"
255+ " | ClassDef(identifier name,\n"
256+ " expr* bases,\n"
257+ " keyword* keywords,\n"
258+ " stmt* body,\n"
259+ " expr* decorator_list,\n"
260+ " type_param* type_params)\n"
261+ " | Return(expr? value)\n"
262+ "\n"
263+ " | Delete(expr* targets)\n"
264+ " | Assign(expr* targets, expr value, string? type_comment)\n"
265+ " | TypeAlias(expr name, type_param* type_params, expr value)\n"
266+ " | AugAssign(expr target, operator op, expr value)\n"
267+ " -- 'simple' indicates that we annotate simple name without parens\n"
268+ " | AnnAssign(expr target, expr annotation, expr? value, int "
269+ "simple)\n"
270+ "\n"
271+ " -- use 'orelse' because else is a keyword in target languages\n"
272+ " | For(expr target, expr iter, stmt* body, stmt* orelse, string? "
273+ "type_comment)\n"
274+ " | AsyncFor(expr target, expr iter, stmt* body, stmt* orelse, "
275+ "string? type_comment)\n"
276+ " | While(expr test, stmt* body, stmt* orelse)\n"
277+ " | If(expr test, stmt* body, stmt* orelse)\n"
278+ " | With(withitem* items, stmt* body, string? type_comment)\n"
279+ " | AsyncWith(withitem* items, stmt* body, string? type_comment)\n"
280+ "\n"
281+ " | Match(expr subject, match_case* cases)\n"
282+ "\n"
283+ " | Raise(expr? exc, expr? cause)\n"
284+ " | Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* "
285+ "finalbody)\n"
286+ " | TryStar(stmt* body, excepthandler* handlers, stmt* orelse, stmt* "
287+ "finalbody)\n"
288+ " | Assert(expr test, expr? msg)\n"
289+ "\n"
290+ " | Import(alias* names)\n"
291+ " | ImportFrom(identifier? module, alias* names, int? level)\n"
292+ "\n"
293+ " | Global(identifier* names)\n"
294+ " | Nonlocal(identifier* names)\n"
295+ " | Expr(expr value)\n"
296+ " | Pass | Break | Continue\n"
297+ "\n"
298+ " -- col_offset is the byte offset in the utf8 string the parser "
299+ "uses\n"
300+ " attributes (int lineno, int col_offset, int? end_lineno, int? "
301+ "end_col_offset)\n"
302+ "\n"
303+ " -- BoolOp() can use left & right?\n"
304+ " expr = BoolOp(boolop op, expr* values)\n"
305+ " | NamedExpr(expr target, expr value)\n"
306+ " | BinOp(expr left, operator op, expr right)\n"
307+ " | UnaryOp(unaryop op, expr operand)\n"
308+ " | Lambda(arguments args, expr body)\n"
309+ " | IfExp(expr test, expr body, expr orelse)\n"
310+ " | Dict(expr?* keys, expr* values)\n"
311+ " | Set(expr* elts)\n"
312+ " | ListComp(expr elt, comprehension* generators)\n"
313+ " | SetComp(expr elt, comprehension* generators)\n"
314+ " | DictComp(expr key, expr value, comprehension* generators)\n"
315+ " | GeneratorExp(expr elt, comprehension* generators)\n"
316+ " -- the grammar constrains where yield expressions can occur\n"
317+ " | Await(expr value)\n"
318+ " | Yield(expr? value)\n"
319+ " | YieldFrom(expr value)\n"
320+ " -- need sequences for compare to distinguish between\n"
321+ " -- x < 4 < 3 and (x < 4) < 3\n"
322+ " | Compare(expr left, cmpop* ops, expr* comparators)\n"
323+ " | Call(expr func, expr* args, keyword* keywords)\n"
324+ " | FormattedValue(expr value, int conversion, expr? format_spec)\n"
325+ " | Interpolation(expr value, constant str, int conversion, expr? "
326+ "format_spec)\n"
327+ " | JoinedStr(expr* values)\n"
328+ " | TemplateStr(expr* values)\n"
329+ " | Constant(constant value, string? kind)\n"
330+ "\n"
331+ " -- the following expression can appear in assignment context\n"
332+ " | Attribute(expr value, identifier attr, expr_context ctx)\n"
333+ " | Subscript(expr value, expr slice, expr_context ctx)\n"
334+ " | Starred(expr value, expr_context ctx)\n"
335+ " | Name(identifier id, expr_context ctx)\n"
336+ " | List(expr* elts, expr_context ctx)\n"
337+ " | Tuple(expr* elts, expr_context ctx)\n"
338+ "\n"
339+ " -- can appear only in Subscript\n"
340+ " | Slice(expr? lower, expr? upper, expr? step)\n"
341+ "\n"
342+ " -- col_offset is the byte offset in the utf8 string the parser "
343+ "uses\n"
344+ " attributes (int lineno, int col_offset, int? end_lineno, int? "
345+ "end_col_offset)\n"
346+ "\n"
347+ " expr_context = Load | Store | Del\n"
348+ "\n"
349+ " boolop = And | Or\n"
350+ "\n"
351+ " operator = Add | Sub | Mult | MatMult | Div | Mod | Pow | LShift\n"
352+ " | RShift | BitOr | BitXor | BitAnd | FloorDiv\n"
353+ "\n"
354+ " unaryop = Invert | Not | UAdd | USub\n"
355+ "\n"
356+ " cmpop = Eq | NotEq | Lt | LtE | Gt | GtE | Is | IsNot | In | NotIn\n"
357+ "\n"
358+ " comprehension = (expr target, expr iter, expr* ifs, int is_async)\n"
359+ "\n"
360+ " excepthandler = ExceptHandler(expr? type, identifier? name, stmt* body)\n"
361+ " attributes (int lineno, int col_offset, int? end_lineno, "
362+ "int? end_col_offset)\n"
363+ "\n"
364+ " arguments = (arg* posonlyargs, arg* args, arg? vararg, arg* kwonlyargs,\n"
365+ " expr?* kw_defaults, arg? kwarg, expr* defaults)\n"
366+ "\n"
367+ " arg = (identifier arg, expr? annotation, string? type_comment)\n"
368+ " attributes (int lineno, int col_offset, int? end_lineno, int? "
369+ "end_col_offset)\n"
370+ "\n"
371+ " -- keyword arguments supplied to call (NULL identifier for **kwargs)\n"
372+ " keyword = (identifier? arg, expr value)\n"
373+ " attributes (int lineno, int col_offset, int? end_lineno, int? "
374+ "end_col_offset)\n"
375+ "\n"
376+ " -- import name with optional 'as' alias.\n"
377+ " alias = (identifier name, identifier? asname)\n"
378+ " attributes (int lineno, int col_offset, int? end_lineno, int? "
379+ "end_col_offset)\n"
380+ "\n"
381+ " withitem = (expr context_expr, expr? optional_vars)\n"
382+ "\n"
383+ " match_case = (pattern pattern, expr? guard, stmt* body)\n"
384+ "\n"
385+ " pattern = MatchValue(expr value)\n"
386+ " | MatchSingleton(constant value)\n"
387+ " | MatchSequence(pattern* patterns)\n"
388+ " | MatchMapping(expr* keys, pattern* patterns, identifier? rest)\n"
389+ " | MatchClass(expr cls, pattern* patterns, identifier* kwd_attrs, "
390+ "pattern* kwd_patterns)\n"
391+ "\n"
392+ " | MatchStar(identifier? name)\n"
393+ " -- The optional \" rest\" MatchMapping parameter handles "
394+ "capturing extra mapping keys\n"
395+ "\n"
396+ " | MatchAs(pattern? pattern, identifier? name)\n"
397+ " | MatchOr(pattern* patterns)\n"
398+ "\n"
399+ " attributes (int lineno, int col_offset, int end_lineno, int "
400+ "end_col_offset)\n"
401+ "\n"
402+ " type_ignore = TypeIgnore(int lineno, string tag)\n"
403+ "\n"
404+ " type_param = TypeVar(identifier name, expr? bound, expr? default_value)\n"
405+ " | ParamSpec(identifier name, expr? default_value)\n"
406+ " | TypeVarTuple(identifier name, expr? default_value)\n"
407+ " attributes (int lineno, int col_offset, int end_lineno, int "
408+ "end_col_offset)\n"
409+ "}\n"
237410
238411#: ../../library/ast.rst:42
239412msgid "Node classes"
0 commit comments