2017-12-28 22:21:54 +00:00
|
|
|
Grammar(
|
2018-07-30 14:46:50 +00:00
|
|
|
single_byte_tokens: [
|
|
|
|
[";", "SEMI"],
|
|
|
|
[",", "COMMA"],
|
|
|
|
["(", "L_PAREN"],
|
|
|
|
[")", "R_PAREN"],
|
|
|
|
["{", "L_CURLY"],
|
|
|
|
["}", "R_CURLY"],
|
|
|
|
["[", "L_BRACK"],
|
|
|
|
["]", "R_BRACK"],
|
|
|
|
["<", "L_ANGLE"],
|
|
|
|
[">", "R_ANGLE"],
|
|
|
|
["@", "AT"],
|
|
|
|
["#", "POUND"],
|
|
|
|
["~", "TILDE"],
|
|
|
|
["?", "QUESTION"],
|
|
|
|
["$", "DOLLAR"],
|
2018-08-05 15:18:02 +00:00
|
|
|
["&", "AMP"],
|
2018-07-30 14:46:50 +00:00
|
|
|
["|", "PIPE"],
|
|
|
|
["+", "PLUS"],
|
|
|
|
["*", "STAR"],
|
|
|
|
["/", "SLASH"],
|
|
|
|
["^", "CARET"],
|
|
|
|
["%", "PERCENT"],
|
|
|
|
],
|
|
|
|
multi_byte_tokens: [
|
|
|
|
[".", "DOT"],
|
|
|
|
["..", "DOTDOT"],
|
|
|
|
["...", "DOTDOTDOT"],
|
|
|
|
["..=", "DOTDOTEQ"],
|
|
|
|
[":", "COLON"],
|
|
|
|
["::", "COLONCOLON"],
|
|
|
|
["=", "EQ"],
|
|
|
|
["==", "EQEQ"],
|
|
|
|
["=>", "FAT_ARROW"],
|
|
|
|
["!", "EXCL"],
|
|
|
|
["!=", "NEQ"],
|
|
|
|
["-", "MINUS"],
|
|
|
|
["->", "THIN_ARROW"],
|
2018-08-05 13:09:25 +00:00
|
|
|
["<=", "LTEQ"],
|
|
|
|
[">=", "GTEQ"],
|
|
|
|
["+=", "PLUSEQ"],
|
|
|
|
["-=", "MINUSEQ"],
|
2018-08-23 21:48:10 +00:00
|
|
|
["|=", "PIPEEQ"],
|
|
|
|
["&=", "AMPEQ"],
|
|
|
|
["^=", "CARETEQ"],
|
|
|
|
["/=", "SLASHEQ"],
|
|
|
|
["*=", "STAREQ"],
|
2018-08-05 15:18:02 +00:00
|
|
|
["&&", "AMPAMP"],
|
2018-08-05 15:16:52 +00:00
|
|
|
["||", "PIPEPIPE"],
|
2018-08-07 11:24:03 +00:00
|
|
|
["<<", "SHL"],
|
|
|
|
[">>", "SHR"],
|
|
|
|
["<<=", "SHLEQ"],
|
|
|
|
[">>=", "SHREQ"],
|
2018-07-30 14:46:50 +00:00
|
|
|
],
|
2018-01-01 15:58:46 +00:00
|
|
|
keywords: [
|
|
|
|
"use",
|
|
|
|
"fn",
|
|
|
|
"struct",
|
|
|
|
"enum",
|
|
|
|
"trait",
|
|
|
|
"impl",
|
2018-08-13 14:42:43 +00:00
|
|
|
"dyn",
|
2018-01-08 18:21:59 +00:00
|
|
|
"true",
|
|
|
|
"false",
|
2018-01-08 21:06:42 +00:00
|
|
|
"as",
|
|
|
|
"extern",
|
|
|
|
"crate",
|
2018-01-09 19:35:55 +00:00
|
|
|
"mod",
|
2018-01-12 19:05:46 +00:00
|
|
|
"pub",
|
|
|
|
"self",
|
|
|
|
"super",
|
2018-01-13 08:55:03 +00:00
|
|
|
"in",
|
2018-01-13 19:00:26 +00:00
|
|
|
"where",
|
2018-01-30 19:53:19 +00:00
|
|
|
"for",
|
|
|
|
"loop",
|
|
|
|
"while",
|
2018-08-24 08:21:13 +00:00
|
|
|
"continue",
|
|
|
|
"break",
|
2018-01-30 19:53:19 +00:00
|
|
|
"if",
|
2018-07-31 21:14:26 +00:00
|
|
|
"else",
|
2018-02-02 20:30:17 +00:00
|
|
|
"match",
|
|
|
|
"const",
|
|
|
|
"static",
|
2018-02-02 20:45:15 +00:00
|
|
|
"mut",
|
2018-02-03 09:05:25 +00:00
|
|
|
"unsafe",
|
2018-02-10 09:35:40 +00:00
|
|
|
"type",
|
2018-02-17 22:06:48 +00:00
|
|
|
"ref",
|
|
|
|
"let",
|
2018-07-31 21:30:17 +00:00
|
|
|
"move",
|
2018-08-01 08:27:31 +00:00
|
|
|
"return",
|
2018-01-01 15:58:46 +00:00
|
|
|
],
|
2018-02-04 13:46:26 +00:00
|
|
|
contextual_keywords: [
|
|
|
|
"auto",
|
|
|
|
"default",
|
|
|
|
"union",
|
|
|
|
],
|
2017-12-31 20:27:36 +00:00
|
|
|
tokens: [
|
2017-12-29 21:48:47 +00:00
|
|
|
"ERROR",
|
2017-12-28 22:21:54 +00:00
|
|
|
"IDENT",
|
2017-12-29 21:48:47 +00:00
|
|
|
"UNDERSCORE",
|
2017-12-28 22:21:54 +00:00
|
|
|
"WHITESPACE",
|
2017-12-30 12:22:40 +00:00
|
|
|
"INT_NUMBER",
|
|
|
|
"FLOAT_NUMBER",
|
2017-12-31 07:41:42 +00:00
|
|
|
"LIFETIME",
|
2017-12-31 11:02:55 +00:00
|
|
|
"CHAR",
|
|
|
|
"BYTE",
|
|
|
|
"STRING",
|
|
|
|
"RAW_STRING",
|
|
|
|
"BYTE_STRING",
|
|
|
|
"RAW_BYTE_STRING",
|
2017-12-31 13:42:22 +00:00
|
|
|
"COMMENT",
|
|
|
|
"DOC_COMMENT",
|
|
|
|
"SHEBANG",
|
2017-12-31 20:27:36 +00:00
|
|
|
],
|
|
|
|
nodes: [
|
2018-08-25 08:44:17 +00:00
|
|
|
"ROOT",
|
2018-02-02 19:08:14 +00:00
|
|
|
|
2018-08-13 15:27:26 +00:00
|
|
|
"STRUCT_DEF",
|
|
|
|
"ENUM_DEF",
|
|
|
|
"FN_DEF",
|
2018-08-28 18:11:17 +00:00
|
|
|
"RET_TYPE",
|
2018-01-08 21:06:42 +00:00
|
|
|
"EXTERN_CRATE_ITEM",
|
2018-08-11 07:56:40 +00:00
|
|
|
"MODULE",
|
2018-01-09 20:32:18 +00:00
|
|
|
"USE_ITEM",
|
2018-08-13 15:27:26 +00:00
|
|
|
"STATIC_DEF",
|
|
|
|
"CONST_DEF",
|
|
|
|
"TRAIT_DEF",
|
2018-02-04 10:39:24 +00:00
|
|
|
"IMPL_ITEM",
|
2018-08-13 15:27:26 +00:00
|
|
|
"TYPE_DEF",
|
2018-08-05 11:08:46 +00:00
|
|
|
"MACRO_CALL",
|
|
|
|
"TOKEN_TREE",
|
2018-02-02 19:08:14 +00:00
|
|
|
|
2018-02-10 21:46:17 +00:00
|
|
|
"PAREN_TYPE",
|
|
|
|
"TUPLE_TYPE",
|
|
|
|
"NEVER_TYPE",
|
|
|
|
"PATH_TYPE",
|
2018-02-11 08:19:54 +00:00
|
|
|
"POINTER_TYPE",
|
2018-02-11 08:37:08 +00:00
|
|
|
"ARRAY_TYPE",
|
|
|
|
"SLICE_TYPE",
|
2018-02-11 08:54:09 +00:00
|
|
|
"REFERENCE_TYPE",
|
2018-02-11 08:57:05 +00:00
|
|
|
"PLACEHOLDER_TYPE",
|
2018-02-11 09:51:09 +00:00
|
|
|
"FN_POINTER_TYPE",
|
2018-02-11 20:32:49 +00:00
|
|
|
"FOR_TYPE",
|
2018-07-31 19:41:29 +00:00
|
|
|
"IMPL_TRAIT_TYPE",
|
2018-08-13 14:42:43 +00:00
|
|
|
"DYN_TRAIT_TYPE",
|
2018-02-10 21:46:17 +00:00
|
|
|
|
2018-02-17 22:06:48 +00:00
|
|
|
"REF_PAT",
|
|
|
|
"BIND_PAT",
|
|
|
|
"PLACEHOLDER_PAT",
|
2018-08-04 12:47:45 +00:00
|
|
|
"PATH_PAT",
|
|
|
|
"STRUCT_PAT",
|
2018-08-24 16:27:30 +00:00
|
|
|
"FIELD_PAT_LIST",
|
2018-08-07 11:41:03 +00:00
|
|
|
"TUPLE_STRUCT_PAT",
|
2018-08-04 12:47:45 +00:00
|
|
|
"TUPLE_PAT",
|
2018-08-07 14:00:45 +00:00
|
|
|
"SLICE_PAT",
|
2018-08-08 12:05:33 +00:00
|
|
|
"RANGE_PAT",
|
2018-02-17 22:06:48 +00:00
|
|
|
|
2018-08-04 13:34:54 +00:00
|
|
|
// atoms
|
2018-02-17 22:06:48 +00:00
|
|
|
"TUPLE_EXPR",
|
2018-08-05 15:24:56 +00:00
|
|
|
"ARRAY_EXPR",
|
2018-08-05 14:19:03 +00:00
|
|
|
"PAREN_EXPR",
|
2018-07-30 14:02:51 +00:00
|
|
|
"PATH_EXPR",
|
2018-07-31 20:13:08 +00:00
|
|
|
"LAMBDA_EXPR",
|
2018-07-31 21:14:26 +00:00
|
|
|
"IF_EXPR",
|
2018-08-27 09:22:09 +00:00
|
|
|
"WHILE_EXPR",
|
|
|
|
"CONDITION",
|
2018-08-05 15:16:52 +00:00
|
|
|
"LOOP_EXPR",
|
2018-08-24 08:45:14 +00:00
|
|
|
"FOR_EXPR",
|
2018-08-24 08:21:13 +00:00
|
|
|
"CONTINUE_EXPR",
|
|
|
|
"BREAK_EXPR",
|
2018-08-24 08:45:14 +00:00
|
|
|
"LABEL",
|
2018-08-01 08:27:31 +00:00
|
|
|
"BLOCK_EXPR",
|
|
|
|
"RETURN_EXPR",
|
2018-08-04 10:39:03 +00:00
|
|
|
"MATCH_EXPR",
|
2018-08-24 16:27:30 +00:00
|
|
|
"MATCH_ARM_LIST",
|
2018-08-04 10:39:03 +00:00
|
|
|
"MATCH_ARM",
|
|
|
|
"MATCH_GUARD",
|
2018-08-04 13:34:54 +00:00
|
|
|
"STRUCT_LIT",
|
2018-08-24 16:27:30 +00:00
|
|
|
"NAMED_FIELD_LIST",
|
|
|
|
"NAMED_FIELD",
|
2018-08-04 13:34:54 +00:00
|
|
|
|
|
|
|
// postfix
|
|
|
|
"CALL_EXPR",
|
2018-08-05 14:24:44 +00:00
|
|
|
"INDEX_EXPR",
|
2018-08-04 13:34:54 +00:00
|
|
|
"METHOD_CALL_EXPR",
|
|
|
|
"FIELD_EXPR",
|
|
|
|
"TRY_EXPR",
|
2018-08-07 00:55:16 +00:00
|
|
|
"CAST_EXPR",
|
2018-08-04 13:34:54 +00:00
|
|
|
|
|
|
|
// unary
|
|
|
|
"REF_EXPR",
|
2018-08-07 11:52:03 +00:00
|
|
|
"PREFIX_EXPR",
|
2018-08-04 13:34:54 +00:00
|
|
|
|
2018-08-05 15:07:06 +00:00
|
|
|
"RANGE_EXPR", // just weird
|
2018-08-04 13:34:54 +00:00
|
|
|
"BIN_EXPR",
|
|
|
|
|
2018-08-24 16:27:30 +00:00
|
|
|
"BLOCK",
|
|
|
|
"EXTERN_BLOCK",
|
|
|
|
"EXTERN_ITEM_LIST",
|
2018-02-02 19:08:14 +00:00
|
|
|
"ENUM_VARIANT",
|
2018-08-24 16:27:30 +00:00
|
|
|
"NAMED_FIELD_DEF_LIST",
|
|
|
|
"NAMED_FIELD_DEF",
|
|
|
|
"POS_FIELD_LIST",
|
2018-02-02 19:08:14 +00:00
|
|
|
"POS_FIELD",
|
2018-08-24 16:27:30 +00:00
|
|
|
"ENUM_VARIANT_LIST",
|
|
|
|
"ITEM_LIST",
|
2018-02-02 19:08:14 +00:00
|
|
|
"ATTR",
|
|
|
|
"META_ITEM", // not an item actually
|
2018-01-13 10:42:19 +00:00
|
|
|
"USE_TREE",
|
2018-08-24 16:27:30 +00:00
|
|
|
"USE_TREE_LIST",
|
2018-01-09 20:32:18 +00:00
|
|
|
"PATH",
|
|
|
|
"PATH_SEGMENT",
|
2018-01-08 18:40:00 +00:00
|
|
|
"LITERAL",
|
2018-01-08 21:06:42 +00:00
|
|
|
"ALIAS",
|
2018-01-12 19:05:46 +00:00
|
|
|
"VISIBILITY",
|
2018-02-10 09:53:07 +00:00
|
|
|
"WHERE_CLAUSE",
|
2018-08-08 16:26:38 +00:00
|
|
|
"WHERE_PRED",
|
2018-02-02 19:08:14 +00:00
|
|
|
"ABI",
|
2018-02-10 11:00:23 +00:00
|
|
|
"NAME",
|
|
|
|
"NAME_REF",
|
2018-07-31 09:59:52 +00:00
|
|
|
|
2018-02-17 22:06:48 +00:00
|
|
|
"LET_STMT",
|
2018-07-31 09:59:52 +00:00
|
|
|
"EXPR_STMT",
|
2018-07-30 14:02:51 +00:00
|
|
|
|
|
|
|
"TYPE_PARAM_LIST",
|
2018-07-31 16:37:40 +00:00
|
|
|
"LIFETIME_PARAM",
|
|
|
|
"TYPE_PARAM",
|
2018-07-30 14:02:51 +00:00
|
|
|
"TYPE_ARG_LIST",
|
2018-07-31 16:37:40 +00:00
|
|
|
"LIFETIME_ARG",
|
|
|
|
"TYPE_ARG",
|
|
|
|
"ASSOC_TYPE_ARG",
|
2018-07-31 09:32:53 +00:00
|
|
|
|
|
|
|
"PARAM_LIST",
|
2018-07-31 20:13:55 +00:00
|
|
|
"PARAM",
|
2018-07-31 15:03:50 +00:00
|
|
|
"SELF_PARAM",
|
2018-07-31 09:32:53 +00:00
|
|
|
"ARG_LIST",
|
2018-08-09 14:43:39 +00:00
|
|
|
],
|
2018-08-11 07:11:58 +00:00
|
|
|
ast: {
|
2018-08-25 08:44:17 +00:00
|
|
|
"Root": (
|
2018-08-11 06:38:27 +00:00
|
|
|
collections: [
|
2018-08-28 16:23:55 +00:00
|
|
|
["items", "ModuleItem"],
|
2018-08-21 15:30:10 +00:00
|
|
|
["functions", "FnDef"],
|
|
|
|
["modules", "Module"],
|
2018-08-11 06:38:27 +00:00
|
|
|
]
|
2018-08-09 14:43:39 +00:00
|
|
|
),
|
2018-08-26 09:09:28 +00:00
|
|
|
"FnDef": (
|
|
|
|
traits: [
|
|
|
|
"NameOwner",
|
|
|
|
"TypeParamsOwner",
|
|
|
|
"AttrsOwner",
|
|
|
|
],
|
|
|
|
options: [
|
2018-08-27 07:01:31 +00:00
|
|
|
["param_list", "ParamList"],
|
|
|
|
["body", "Block"],
|
2018-08-28 18:11:17 +00:00
|
|
|
["ret_type", "RetType"]
|
2018-08-26 09:09:28 +00:00
|
|
|
],
|
|
|
|
),
|
2018-08-28 18:11:17 +00:00
|
|
|
"RetType": (),
|
2018-08-14 11:45:56 +00:00
|
|
|
"StructDef": (
|
2018-08-22 13:46:42 +00:00
|
|
|
traits: [
|
|
|
|
"NameOwner",
|
|
|
|
"TypeParamsOwner",
|
|
|
|
"AttrsOwner",
|
|
|
|
],
|
2018-08-14 11:45:56 +00:00
|
|
|
collections: [
|
2018-08-24 16:27:30 +00:00
|
|
|
["fields", "NamedFieldDef"]
|
2018-08-14 11:45:56 +00:00
|
|
|
]
|
|
|
|
),
|
2018-08-24 16:27:30 +00:00
|
|
|
"NamedFieldDef": ( traits: ["NameOwner", "AttrsOwner"] ),
|
2018-08-22 13:46:42 +00:00
|
|
|
"EnumDef": ( traits: [
|
|
|
|
"NameOwner",
|
|
|
|
"TypeParamsOwner",
|
|
|
|
"AttrsOwner",
|
|
|
|
] ),
|
2018-08-16 09:51:40 +00:00
|
|
|
"TraitDef": ( traits: ["NameOwner", "AttrsOwner"] ),
|
2018-08-21 15:30:10 +00:00
|
|
|
"Module": (
|
|
|
|
traits: ["NameOwner", "AttrsOwner"],
|
|
|
|
collections: [
|
2018-08-28 08:12:42 +00:00
|
|
|
["items", "ModuleItem"]
|
2018-08-21 15:30:10 +00:00
|
|
|
]
|
|
|
|
),
|
2018-08-22 13:46:42 +00:00
|
|
|
"ConstDef": ( traits: [
|
|
|
|
"NameOwner",
|
|
|
|
"TypeParamsOwner",
|
|
|
|
"AttrsOwner",
|
|
|
|
] ),
|
|
|
|
"StaticDef": ( traits: [
|
|
|
|
"NameOwner",
|
|
|
|
"TypeParamsOwner",
|
|
|
|
"AttrsOwner",
|
|
|
|
] ),
|
|
|
|
"TypeDef": ( traits: [
|
|
|
|
"NameOwner",
|
|
|
|
"TypeParamsOwner",
|
|
|
|
"AttrsOwner",
|
|
|
|
] ),
|
2018-08-14 08:20:09 +00:00
|
|
|
"ImplItem": (),
|
2018-08-14 11:45:56 +00:00
|
|
|
|
2018-08-14 09:38:20 +00:00
|
|
|
"ParenType": (),
|
|
|
|
"TupleType": (),
|
|
|
|
"NeverType": (),
|
|
|
|
"PathType": (),
|
|
|
|
"PointerType": (),
|
|
|
|
"ArrayType": (),
|
|
|
|
"SliceType": (),
|
|
|
|
"ReferenceType": (),
|
|
|
|
"PlaceholderType": (),
|
|
|
|
"FnPointerType": (),
|
|
|
|
"ForType": (),
|
|
|
|
"ImplTraitType": (),
|
|
|
|
"DynTraitType": (),
|
|
|
|
|
|
|
|
"TypeRef": ( enum: [
|
|
|
|
"ParenType",
|
|
|
|
"TupleType",
|
|
|
|
"NeverType",
|
|
|
|
"PathType",
|
|
|
|
"PointerType",
|
|
|
|
"ArrayType",
|
|
|
|
"SliceType",
|
|
|
|
"ReferenceType",
|
|
|
|
"PlaceholderType",
|
|
|
|
"FnPointerType",
|
|
|
|
"ForType",
|
|
|
|
"ImplTraitType",
|
|
|
|
"DynTraitType",
|
2018-08-14 10:33:44 +00:00
|
|
|
]),
|
|
|
|
|
2018-08-16 10:11:20 +00:00
|
|
|
"NominalDef": (
|
|
|
|
enum: ["StructDef", "EnumDef"],
|
2018-08-22 15:05:43 +00:00
|
|
|
traits: [
|
|
|
|
"NameOwner",
|
|
|
|
"TypeParamsOwner",
|
|
|
|
"AttrsOwner"
|
|
|
|
],
|
2018-08-16 10:11:20 +00:00
|
|
|
),
|
2018-08-28 08:12:42 +00:00
|
|
|
"ModuleItem": (
|
|
|
|
enum: ["StructDef", "EnumDef", "FnDef", "TraitDef", "ImplItem",
|
2018-08-30 17:37:33 +00:00
|
|
|
"UseItem", "ExternCrateItem", "ConstDef", "StaticDef", "Module" ]
|
2018-08-28 08:12:42 +00:00
|
|
|
),
|
2018-08-22 13:46:42 +00:00
|
|
|
|
2018-08-25 10:42:40 +00:00
|
|
|
"TupleExpr": (),
|
|
|
|
"ArrayExpr": (),
|
|
|
|
"ParenExpr": (),
|
|
|
|
"PathExpr": (),
|
2018-08-28 20:59:57 +00:00
|
|
|
"LambdaExpr": (
|
|
|
|
options: [
|
|
|
|
["param_list", "ParamList"],
|
|
|
|
["body", "Expr"],
|
|
|
|
]
|
|
|
|
),
|
2018-08-27 09:22:09 +00:00
|
|
|
"IfExpr": (
|
|
|
|
options: [ ["condition", "Condition"] ]
|
|
|
|
),
|
|
|
|
"LoopExpr": (
|
2018-08-30 18:32:12 +00:00
|
|
|
traits: ["LoopBodyOwner"],
|
2018-08-27 09:22:09 +00:00
|
|
|
),
|
|
|
|
"ForExpr": (
|
2018-08-30 18:32:12 +00:00
|
|
|
traits: ["LoopBodyOwner"],
|
2018-08-27 19:03:19 +00:00
|
|
|
options: [
|
|
|
|
["pat", "Pat"],
|
|
|
|
["iterable", "Expr"],
|
|
|
|
]
|
2018-08-27 09:22:09 +00:00
|
|
|
),
|
|
|
|
"WhileExpr": (
|
2018-08-30 18:32:12 +00:00
|
|
|
traits: ["LoopBodyOwner"],
|
2018-08-27 09:22:09 +00:00
|
|
|
options: [
|
|
|
|
["condition", "Condition"],
|
|
|
|
]
|
|
|
|
),
|
2018-08-25 10:42:40 +00:00
|
|
|
"ContinueExpr": (),
|
|
|
|
"BreakExpr": (),
|
|
|
|
"Label": (),
|
2018-08-27 09:22:09 +00:00
|
|
|
"BlockExpr": (
|
|
|
|
options: [ ["block", "Block"] ]
|
|
|
|
),
|
2018-08-25 10:42:40 +00:00
|
|
|
"ReturnExpr": (),
|
|
|
|
"MatchExpr": (),
|
|
|
|
"MatchArmList": (),
|
|
|
|
"MatchArm": (),
|
|
|
|
"MatchGuard": (),
|
|
|
|
"StructLit": (),
|
|
|
|
"NamedFieldList": (),
|
|
|
|
"NamedField": (),
|
2018-08-28 20:59:57 +00:00
|
|
|
"CallExpr": (
|
|
|
|
options: [
|
|
|
|
[ "expr", "Expr" ],
|
|
|
|
[ "arg_list", "ArgList" ],
|
|
|
|
]
|
|
|
|
),
|
2018-08-25 10:42:40 +00:00
|
|
|
"IndexExpr": (),
|
|
|
|
"MethodCallExpr": (),
|
|
|
|
"FieldExpr": (),
|
|
|
|
"TryExpr": (),
|
|
|
|
"CastExpr": (),
|
|
|
|
"RefExpr": (),
|
|
|
|
"PrefixExpr": (),
|
|
|
|
"RangeExpr": (),
|
|
|
|
"BinExpr": (),
|
2018-08-28 11:21:37 +00:00
|
|
|
"Literal": (),
|
2018-08-25 10:42:40 +00:00
|
|
|
|
|
|
|
"Expr": (
|
|
|
|
enum: [
|
|
|
|
"TupleExpr",
|
|
|
|
"ArrayExpr",
|
|
|
|
"ParenExpr",
|
|
|
|
"PathExpr",
|
|
|
|
"LambdaExpr",
|
|
|
|
"IfExpr",
|
|
|
|
"LoopExpr",
|
|
|
|
"ForExpr",
|
|
|
|
"WhileExpr",
|
|
|
|
"ContinueExpr",
|
|
|
|
"BreakExpr",
|
|
|
|
"Label",
|
|
|
|
"BlockExpr",
|
|
|
|
"ReturnExpr",
|
|
|
|
"MatchExpr",
|
|
|
|
"MatchArmList",
|
|
|
|
"MatchArm",
|
|
|
|
"MatchGuard",
|
|
|
|
"StructLit",
|
|
|
|
"NamedFieldList",
|
|
|
|
"NamedField",
|
|
|
|
"CallExpr",
|
|
|
|
"IndexExpr",
|
|
|
|
"MethodCallExpr",
|
|
|
|
"FieldExpr",
|
|
|
|
"TryExpr",
|
|
|
|
"CastExpr",
|
|
|
|
"RefExpr",
|
|
|
|
"PrefixExpr",
|
|
|
|
"RangeExpr",
|
|
|
|
"BinExpr",
|
2018-08-28 11:21:37 +00:00
|
|
|
"Literal",
|
2018-08-25 10:42:40 +00:00
|
|
|
],
|
|
|
|
),
|
|
|
|
|
2018-08-26 09:09:28 +00:00
|
|
|
"RefPat": (),
|
|
|
|
"BindPat": ( traits: ["NameOwner"] ),
|
|
|
|
"PlaceholderPat": (),
|
|
|
|
"PathPat": (),
|
|
|
|
"StructPat": (),
|
|
|
|
"FieldPatList": (),
|
|
|
|
"TupleStructPat": (),
|
|
|
|
"TuplePat": (),
|
|
|
|
"SlicePat": (),
|
|
|
|
"RangePat": (),
|
|
|
|
|
|
|
|
"Pat": (
|
|
|
|
enum: [
|
|
|
|
"RefPat",
|
|
|
|
"BindPat",
|
|
|
|
"PlaceholderPat",
|
|
|
|
"PathPat",
|
|
|
|
"StructPat",
|
|
|
|
"FieldPatList",
|
|
|
|
"TupleStructPat",
|
|
|
|
"TuplePat",
|
|
|
|
"SlicePat",
|
|
|
|
"RangePat",
|
|
|
|
],
|
|
|
|
),
|
|
|
|
|
2018-08-22 13:46:42 +00:00
|
|
|
"Name": (),
|
|
|
|
"NameRef": (),
|
|
|
|
"Attr": ( options: [ ["value", "TokenTree"] ] ),
|
|
|
|
"TokenTree": (),
|
2018-08-28 20:59:57 +00:00
|
|
|
"TypeParamList": (
|
|
|
|
collections: [
|
|
|
|
["type_params", "TypeParam" ],
|
|
|
|
["lifetime_params", "LifetimeParam" ],
|
|
|
|
]
|
|
|
|
),
|
2018-08-26 09:09:28 +00:00
|
|
|
"TypeParam": ( traits: ["NameOwner"] ),
|
2018-08-28 20:59:57 +00:00
|
|
|
"LifetimeParam": ( options: [ ["lifetime", "Lifetime"] ] ),
|
|
|
|
"Lifetime": (),
|
2018-08-22 13:46:42 +00:00
|
|
|
"WhereClause": (),
|
2018-08-27 09:22:09 +00:00
|
|
|
"ExprStmt": (
|
|
|
|
options: [ ["expr", "Expr"] ]
|
|
|
|
),
|
2018-08-27 07:01:31 +00:00
|
|
|
"LetStmt": ( options: [
|
|
|
|
["pat", "Pat"],
|
|
|
|
["initializer", "Expr"],
|
|
|
|
]),
|
2018-08-27 09:22:09 +00:00
|
|
|
"Condition": (
|
|
|
|
options: [
|
|
|
|
[ "pat", "Pat" ],
|
|
|
|
[ "expr", "Expr" ],
|
|
|
|
]
|
|
|
|
),
|
2018-08-27 07:12:28 +00:00
|
|
|
"Stmt": (
|
|
|
|
enum: ["ExprStmt", "LetStmt"],
|
|
|
|
),
|
2018-08-26 09:09:28 +00:00
|
|
|
"Block": (
|
2018-08-27 07:12:28 +00:00
|
|
|
options: [["expr", "Expr"]],
|
2018-08-26 09:09:28 +00:00
|
|
|
collections: [
|
2018-08-27 07:12:28 +00:00
|
|
|
["statements", "Stmt"],
|
2018-08-26 09:09:28 +00:00
|
|
|
]
|
|
|
|
),
|
|
|
|
"ParamList": (
|
|
|
|
collections: [
|
|
|
|
["params", "Param"]
|
|
|
|
]
|
|
|
|
),
|
|
|
|
"Param": (
|
|
|
|
options: [["pat", "Pat"]],
|
2018-08-28 08:12:42 +00:00
|
|
|
),
|
2018-08-30 17:37:33 +00:00
|
|
|
"UseItem": (
|
|
|
|
options: [["use_tree", "UseTree"]]
|
|
|
|
),
|
|
|
|
"UseTree": (
|
|
|
|
options: [
|
|
|
|
["path", "Path"],
|
|
|
|
["use_tree_list", "UseTreeList"],
|
|
|
|
]
|
|
|
|
),
|
|
|
|
"UseTreeList": (
|
|
|
|
collections: [["use_trees", "UseTree"]]
|
|
|
|
),
|
2018-08-28 08:12:42 +00:00
|
|
|
"ExternCrateItem": (),
|
2018-08-28 20:59:57 +00:00
|
|
|
"ArgList": (
|
|
|
|
collections: [
|
|
|
|
["args", "Expr"]
|
|
|
|
]
|
2018-08-30 17:03:18 +00:00
|
|
|
),
|
2018-08-30 17:37:33 +00:00
|
|
|
"Path": (
|
|
|
|
options: [
|
|
|
|
["segment", "PathSegment"]
|
|
|
|
]
|
|
|
|
),
|
|
|
|
"PathSegment": (
|
|
|
|
options: [
|
|
|
|
["name_ref", "NameRef"]
|
|
|
|
]
|
|
|
|
),
|
2018-08-11 07:11:58 +00:00
|
|
|
},
|
2018-01-28 15:53:53 +00:00
|
|
|
)
|