rust/crates/ra_syntax/src/grammar.ron

588 lines
15 KiB
Plaintext
Raw Normal View History

2018-10-04 15:43:58 -05:00
// Stores definitions which must be used in multiple places
2018-10-16 13:09:22 -05:00
// See `cargo gen-syntax` (defined in crates/tools/src/main.rs)
2017-12-28 16:21:54 -06:00
Grammar(
2018-07-30 09:46:50 -05: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 10:18:02 -05:00
["&", "AMP"],
2018-07-30 09:46:50 -05:00
["|", "PIPE"],
["+", "PLUS"],
["*", "STAR"],
["/", "SLASH"],
["^", "CARET"],
["%", "PERCENT"],
],
// Tokens for which the longest match must be chosen (e.g. `..` is a DOTDOT, but `.` is a DOT)
2018-07-30 09:46:50 -05:00
multi_byte_tokens: [
[".", "DOT"],
2018-07-30 09:46:50 -05:00
["..", "DOTDOT"],
["...", "DOTDOTDOT"],
["..=", "DOTDOTEQ"],
[":", "COLON"],
["::", "COLONCOLON"],
["=", "EQ"],
["==", "EQEQ"],
["=>", "FAT_ARROW"],
["!", "EXCL"],
["!=", "NEQ"],
["-", "MINUS"],
["->", "THIN_ARROW"],
2018-08-05 08:09:25 -05:00
["<=", "LTEQ"],
[">=", "GTEQ"],
["+=", "PLUSEQ"],
["-=", "MINUSEQ"],
2018-08-23 16:48:10 -05:00
["|=", "PIPEEQ"],
["&=", "AMPEQ"],
["^=", "CARETEQ"],
["/=", "SLASHEQ"],
["*=", "STAREQ"],
2019-01-07 12:03:25 -06:00
["%=", "PERCENTEQ"],
2018-08-05 10:18:02 -05:00
["&&", "AMPAMP"],
2018-08-05 10:16:52 -05:00
["||", "PIPEPIPE"],
2018-08-07 06:24:03 -05:00
["<<", "SHL"],
[">>", "SHR"],
["<<=", "SHLEQ"],
[">>=", "SHREQ"],
2018-07-30 09:46:50 -05:00
],
2018-01-01 09:58:46 -06:00
keywords: [
"use",
"fn",
"struct",
"enum",
"trait",
"impl",
2018-08-13 09:42:43 -05:00
"dyn",
2018-01-08 12:21:59 -06:00
"true",
"false",
2018-01-08 15:06:42 -06:00
"as",
"extern",
"crate",
2018-01-09 13:35:55 -06:00
"mod",
2018-01-12 13:05:46 -06:00
"pub",
"self",
"super",
2018-01-13 02:55:03 -06:00
"in",
2018-01-13 13:00:26 -06:00
"where",
2018-01-30 13:53:19 -06:00
"for",
"loop",
"while",
2018-08-24 03:21:13 -05:00
"continue",
"break",
2018-01-30 13:53:19 -06:00
"if",
2018-07-31 16:14:26 -05:00
"else",
2018-02-02 14:30:17 -06:00
"match",
"const",
"static",
2018-02-02 14:45:15 -06:00
"mut",
2018-02-03 03:05:25 -06:00
"unsafe",
2018-02-10 03:35:40 -06:00
"type",
"ref",
"let",
2018-07-31 16:30:17 -05:00
"move",
2018-08-01 03:27:31 -05:00
"return",
2018-01-01 09:58:46 -06:00
],
2018-02-04 07:46:26 -06:00
contextual_keywords: [
"auto",
"default",
"union",
],
2017-12-31 14:27:36 -06:00
tokens: [
2017-12-29 15:48:47 -06:00
"ERROR",
2017-12-28 16:21:54 -06:00
"IDENT",
2017-12-29 15:48:47 -06:00
"UNDERSCORE",
2017-12-28 16:21:54 -06:00
"WHITESPACE",
2017-12-30 06:22:40 -06:00
"INT_NUMBER",
"FLOAT_NUMBER",
2017-12-31 01:41:42 -06:00
"LIFETIME",
2017-12-31 05:02:55 -06:00
"CHAR",
"BYTE",
"STRING",
"RAW_STRING",
"BYTE_STRING",
"RAW_BYTE_STRING",
2017-12-31 07:42:22 -06:00
"COMMENT",
"SHEBANG",
2017-12-31 14:27:36 -06:00
],
nodes: [
2018-11-07 09:38:43 -06:00
"SOURCE_FILE",
2018-02-02 13:08:14 -06:00
2018-08-13 10:27:26 -05:00
"STRUCT_DEF",
"ENUM_DEF",
"FN_DEF",
2018-08-28 13:11:17 -05:00
"RET_TYPE",
2018-01-08 15:06:42 -06:00
"EXTERN_CRATE_ITEM",
2018-08-11 02:56:40 -05:00
"MODULE",
2018-01-09 14:32:18 -06:00
"USE_ITEM",
2018-08-13 10:27:26 -05:00
"STATIC_DEF",
"CONST_DEF",
"TRAIT_DEF",
"IMPL_BLOCK",
2018-08-13 10:27:26 -05:00
"TYPE_DEF",
2018-08-05 06:08:46 -05:00
"MACRO_CALL",
"TOKEN_TREE",
2018-02-02 13:08:14 -06:00
2018-02-10 15:46:17 -06:00
"PAREN_TYPE",
"TUPLE_TYPE",
"NEVER_TYPE",
"PATH_TYPE",
2018-02-11 02:19:54 -06:00
"POINTER_TYPE",
2018-02-11 02:37:08 -06:00
"ARRAY_TYPE",
"SLICE_TYPE",
2018-02-11 02:54:09 -06:00
"REFERENCE_TYPE",
2018-02-11 02:57:05 -06:00
"PLACEHOLDER_TYPE",
2018-02-11 03:51:09 -06:00
"FN_POINTER_TYPE",
2018-02-11 14:32:49 -06:00
"FOR_TYPE",
2018-07-31 14:41:29 -05:00
"IMPL_TRAIT_TYPE",
2018-08-13 09:42:43 -05:00
"DYN_TRAIT_TYPE",
2018-02-10 15:46:17 -06:00
"REF_PAT",
"BIND_PAT",
"PLACEHOLDER_PAT",
2018-08-04 07:47:45 -05:00
"PATH_PAT",
"STRUCT_PAT",
2018-08-24 11:27:30 -05:00
"FIELD_PAT_LIST",
2018-08-07 06:41:03 -05:00
"TUPLE_STRUCT_PAT",
2018-08-04 07:47:45 -05:00
"TUPLE_PAT",
2018-08-07 09:00:45 -05:00
"SLICE_PAT",
2018-08-08 07:05:33 -05:00
"RANGE_PAT",
2018-08-04 08:34:54 -05:00
// atoms
"TUPLE_EXPR",
2018-08-05 10:24:56 -05:00
"ARRAY_EXPR",
2018-08-05 09:19:03 -05:00
"PAREN_EXPR",
2018-07-30 09:02:51 -05:00
"PATH_EXPR",
2018-07-31 15:13:08 -05:00
"LAMBDA_EXPR",
2018-07-31 16:14:26 -05:00
"IF_EXPR",
2018-08-27 04:22:09 -05:00
"WHILE_EXPR",
"CONDITION",
2018-08-05 10:16:52 -05:00
"LOOP_EXPR",
2018-08-24 03:45:14 -05:00
"FOR_EXPR",
2018-08-24 03:21:13 -05:00
"CONTINUE_EXPR",
"BREAK_EXPR",
2018-08-24 03:45:14 -05:00
"LABEL",
2018-08-01 03:27:31 -05:00
"BLOCK_EXPR",
"RETURN_EXPR",
2018-08-04 05:39:03 -05:00
"MATCH_EXPR",
2018-08-24 11:27:30 -05:00
"MATCH_ARM_LIST",
2018-08-04 05:39:03 -05:00
"MATCH_ARM",
"MATCH_GUARD",
2018-08-04 08:34:54 -05:00
"STRUCT_LIT",
2018-08-24 11:27:30 -05:00
"NAMED_FIELD_LIST",
"NAMED_FIELD",
2018-08-04 08:34:54 -05:00
// postfix
"CALL_EXPR",
2018-08-05 09:24:44 -05:00
"INDEX_EXPR",
2018-08-04 08:34:54 -05:00
"METHOD_CALL_EXPR",
"FIELD_EXPR",
"TRY_EXPR",
2018-08-06 19:55:16 -05:00
"CAST_EXPR",
2018-08-04 08:34:54 -05:00
// unary
"REF_EXPR",
2018-08-07 06:52:03 -05:00
"PREFIX_EXPR",
2018-08-04 08:34:54 -05:00
2018-08-05 10:07:06 -05:00
"RANGE_EXPR", // just weird
2018-08-04 08:34:54 -05:00
"BIN_EXPR",
2018-08-24 11:27:30 -05:00
"BLOCK",
"EXTERN_BLOCK",
"EXTERN_ITEM_LIST",
2018-02-02 13:08:14 -06:00
"ENUM_VARIANT",
2018-08-24 11:27:30 -05:00
"NAMED_FIELD_DEF_LIST",
"NAMED_FIELD_DEF",
"POS_FIELD_LIST",
2018-02-02 13:08:14 -06:00
"POS_FIELD",
2018-08-24 11:27:30 -05:00
"ENUM_VARIANT_LIST",
"ITEM_LIST",
2018-02-02 13:08:14 -06:00
"ATTR",
"META_ITEM", // not an item actually
2018-01-13 04:42:19 -06:00
"USE_TREE",
2018-08-24 11:27:30 -05:00
"USE_TREE_LIST",
2018-01-09 14:32:18 -06:00
"PATH",
"PATH_SEGMENT",
2018-01-08 12:40:00 -06:00
"LITERAL",
2018-01-08 15:06:42 -06:00
"ALIAS",
2018-01-12 13:05:46 -06:00
"VISIBILITY",
2018-02-10 03:53:07 -06:00
"WHERE_CLAUSE",
2018-08-08 11:26:38 -05:00
"WHERE_PRED",
2018-02-02 13:08:14 -06:00
"ABI",
2018-02-10 05:00:23 -06:00
"NAME",
"NAME_REF",
2018-07-31 04:59:52 -05:00
"LET_STMT",
2018-07-31 04:59:52 -05:00
"EXPR_STMT",
2018-07-30 09:02:51 -05:00
"TYPE_PARAM_LIST",
2018-07-31 11:37:40 -05:00
"LIFETIME_PARAM",
"TYPE_PARAM",
2018-07-30 09:02:51 -05:00
"TYPE_ARG_LIST",
2018-07-31 11:37:40 -05:00
"LIFETIME_ARG",
"TYPE_ARG",
"ASSOC_TYPE_ARG",
2018-07-31 04:32:53 -05:00
"PARAM_LIST",
2018-07-31 15:13:55 -05:00
"PARAM",
2018-07-31 10:03:50 -05:00
"SELF_PARAM",
2018-07-31 04:32:53 -05:00
"ARG_LIST",
2018-08-09 09:43:39 -05:00
],
2018-08-11 02:11:58 -05:00
ast: {
2018-11-07 09:38:43 -06:00
"SourceFile": (
2018-09-07 17:35:20 -05:00
traits: [ "ModuleItemOwner", "FnDefOwner" ],
2018-08-11 01:38:27 -05:00
collections: [
2018-08-21 10:30:10 -05:00
["modules", "Module"],
2018-08-11 01:38:27 -05:00
]
2018-08-09 09:43:39 -05:00
),
2018-08-26 04:09:28 -05:00
"FnDef": (
traits: [
2019-01-03 04:47:28 -06:00
"VisibilityOwner",
2018-08-26 04:09:28 -05:00
"NameOwner",
"TypeParamsOwner",
"AttrsOwner",
"DocCommentsOwner"
2018-08-26 04:09:28 -05:00
],
2018-08-31 07:10:37 -05:00
options: [ "ParamList", ["body", "Block"], "RetType" ],
2018-08-26 04:09:28 -05:00
),
"RetType": (options: ["TypeRef"]),
2018-08-14 06:45:56 -05:00
"StructDef": (
2018-08-22 08:46:42 -05:00
traits: [
2019-01-03 04:47:28 -06:00
"VisibilityOwner",
2018-08-22 08:46:42 -05:00
"NameOwner",
"TypeParamsOwner",
"AttrsOwner",
2018-11-02 08:59:07 -05:00
"DocCommentsOwner"
2018-08-14 06:45:56 -05:00
]
),
"NamedFieldDefList": (collections: [["fields", "NamedFieldDef"]]),
2019-01-03 04:47:28 -06:00
"NamedFieldDef": ( traits: ["VisibilityOwner", "NameOwner", "AttrsOwner"], options: ["TypeRef"] ),
"PosFieldList": (collections: [["fields", "PosField"]]),
2019-01-03 04:47:28 -06:00
"PosField": ( traits: ["VisibilityOwner", "AttrsOwner"], options: ["TypeRef"]),
2018-08-22 08:46:42 -05:00
"EnumDef": ( traits: [
2019-01-03 04:47:28 -06:00
"VisibilityOwner",
2018-08-22 08:46:42 -05:00
"NameOwner",
"TypeParamsOwner",
"AttrsOwner",
2018-11-02 08:59:07 -05:00
"DocCommentsOwner"
], options: [["variant_list", "EnumVariantList"]] ),
"EnumVariantList": ( collections: [["variants", "EnumVariant"]] ),
"EnumVariant": ( traits: ["NameOwner"], options: ["Expr"] ),
2019-01-03 04:47:28 -06:00
"TraitDef": ( traits: ["VisibilityOwner", "NameOwner", "AttrsOwner", "DocCommentsOwner"] ),
2018-08-21 10:30:10 -05:00
"Module": (
2019-01-03 04:47:28 -06:00
traits: ["VisibilityOwner", "NameOwner", "AttrsOwner", "DocCommentsOwner" ],
2018-09-03 07:10:06 -05:00
options: [ "ItemList" ]
),
"ItemList": (
collections: [["impl_items", "ImplItem"]],
2018-09-07 17:35:20 -05:00
traits: [ "FnDefOwner", "ModuleItemOwner" ],
2018-08-21 10:30:10 -05:00
),
2018-08-22 08:46:42 -05:00
"ConstDef": ( traits: [
2019-01-03 04:47:28 -06:00
"VisibilityOwner",
2018-08-22 08:46:42 -05:00
"NameOwner",
"TypeParamsOwner",
"AttrsOwner",
2018-11-02 08:59:07 -05:00
"DocCommentsOwner"
2018-08-22 08:46:42 -05:00
] ),
"StaticDef": ( traits: [
2019-01-03 04:47:28 -06:00
"VisibilityOwner",
2018-08-22 08:46:42 -05:00
"NameOwner",
"TypeParamsOwner",
"AttrsOwner",
2018-11-02 08:59:07 -05:00
"DocCommentsOwner"
2018-08-22 08:46:42 -05:00
] ),
"TypeDef": ( traits: [
2019-01-03 04:47:28 -06:00
"VisibilityOwner",
2018-08-22 08:46:42 -05:00
"NameOwner",
"TypeParamsOwner",
"AttrsOwner",
2018-11-02 08:59:07 -05:00
"DocCommentsOwner"
2018-08-22 08:46:42 -05:00
] ),
"ImplBlock": (options: ["ItemList"]),
2018-08-14 06:45:56 -05:00
"ParenType": (options: ["TypeRef"]),
"TupleType": ( collections: [["fields", "TypeRef"]] ),
2018-08-14 04:38:20 -05:00
"NeverType": (),
2018-12-22 15:17:55 -06:00
"PathType": (options: ["Path"]),
"PointerType": (options: ["TypeRef"]),
"ArrayType": ( options: ["TypeRef", "Expr"] ),
"SliceType": ( options: ["TypeRef"] ),
"ReferenceType": (options: ["TypeRef"]),
2018-08-14 04:38:20 -05:00
"PlaceholderType": (),
"FnPointerType": (options: ["ParamList", "RetType"]),
"ForType": (options: ["TypeRef"]),
2018-08-14 04:38:20 -05:00
"ImplTraitType": (),
"DynTraitType": (),
"TypeRef": ( enum: [
"ParenType",
"TupleType",
"NeverType",
"PathType",
"PointerType",
"ArrayType",
"SliceType",
"ReferenceType",
"PlaceholderType",
"FnPointerType",
"ForType",
"ImplTraitType",
"DynTraitType",
2018-08-14 05:33:44 -05:00
]),
2018-08-16 05:11:20 -05:00
"NominalDef": (
enum: ["StructDef", "EnumDef"],
2018-08-22 10:05:43 -05:00
traits: [
"NameOwner",
"TypeParamsOwner",
"AttrsOwner"
],
2018-08-16 05:11:20 -05:00
),
2018-08-28 03:12:42 -05:00
"ModuleItem": (
enum: ["StructDef", "EnumDef", "FnDef", "TraitDef", "TypeDef", "ImplBlock",
2018-08-30 12:37:33 -05:00
"UseItem", "ExternCrateItem", "ConstDef", "StaticDef", "Module" ]
2018-08-28 03:12:42 -05:00
),
"ImplItem": (
enum: ["FnDef", "TypeDef", "ConstDef"]
),
2018-08-22 08:46:42 -05:00
2019-01-13 05:52:25 -06:00
"TupleExpr": (
collections: [["exprs", "Expr"]]
),
2018-08-25 05:42:40 -05:00
"ArrayExpr": (),
2018-12-20 14:56:28 -06:00
"ParenExpr": (options: ["Expr"]),
"PathExpr": (options: ["Path"]),
2018-08-28 15:59:57 -05:00
"LambdaExpr": (
options: [
2018-08-31 07:10:37 -05:00
"ParamList",
2018-08-28 15:59:57 -05:00
["body", "Expr"],
]
),
2018-08-27 04:22:09 -05:00
"IfExpr": (
2018-08-31 07:10:37 -05:00
options: [ "Condition" ]
2018-08-27 04:22:09 -05:00
),
"LoopExpr": (
2018-08-30 13:32:12 -05:00
traits: ["LoopBodyOwner"],
2018-08-27 04:22:09 -05:00
),
"ForExpr": (
2018-08-30 13:32:12 -05:00
traits: ["LoopBodyOwner"],
2018-08-27 14:03:19 -05:00
options: [
2018-08-31 07:10:37 -05:00
"Pat",
2018-08-27 14:03:19 -05:00
["iterable", "Expr"],
]
2018-08-27 04:22:09 -05:00
),
"WhileExpr": (
2018-08-30 13:32:12 -05:00
traits: ["LoopBodyOwner"],
2018-08-31 07:10:37 -05:00
options: [ "Condition" ]
2018-08-27 04:22:09 -05:00
),
2018-08-25 05:42:40 -05:00
"ContinueExpr": (),
2019-01-05 09:32:07 -06:00
"BreakExpr": (options: ["Expr"]),
2018-08-25 05:42:40 -05:00
"Label": (),
2018-08-27 04:22:09 -05:00
"BlockExpr": (
2018-08-31 07:10:37 -05:00
options: [ "Block" ]
2018-08-27 04:22:09 -05:00
),
2018-12-20 14:56:28 -06:00
"ReturnExpr": (options: ["Expr"]),
2018-09-02 17:51:46 -05:00
"MatchExpr": (
options: [ "Expr", "MatchArmList" ],
),
"MatchArmList": (
collections: [ ["arms", "MatchArm"] ],
),
"MatchArm": (
options: [
[ "guard", "MatchGuard" ],
"Expr",
],
collections: [ [ "pats", "Pat" ] ]
),
2018-08-25 05:42:40 -05:00
"MatchGuard": (),
2019-01-05 09:32:07 -06:00
"StructLit": (options: ["Path", "NamedFieldList", ["spread", "Expr"]]),
"NamedFieldList": (collections: [ ["fields", "NamedField"] ]),
"NamedField": (options: ["NameRef", "Expr"]),
2018-08-28 15:59:57 -05:00
"CallExpr": (
2018-09-02 18:01:43 -05:00
traits: ["ArgListOwner"],
options: [ "Expr" ],
),
"MethodCallExpr": (
traits: ["ArgListOwner"],
2018-12-25 08:15:40 -06:00
options: [ "Expr", "NameRef" ],
2018-08-28 15:59:57 -05:00
),
2018-08-25 05:42:40 -05:00
"IndexExpr": (),
2018-12-25 06:54:38 -06:00
"FieldExpr": (options: ["Expr", "NameRef"]),
2018-12-20 14:56:28 -06:00
"TryExpr": (options: ["Expr"]),
"CastExpr": (options: ["Expr", "TypeRef"]),
"RefExpr": (options: ["Expr"]),
"PrefixExpr": (options: ["Expr"]),
2018-08-25 05:42:40 -05:00
"RangeExpr": (),
"BinExpr": (),
"IntNumber": ( traits: ["AstToken"] ),
"FloatNumber": ( traits: ["AstToken"] ),
2019-01-08 03:23:10 -06:00
"String": ( traits: ["AstToken"] ),
"Byte": ( traits: ["AstToken"] ),
"ByteString": ( traits: ["AstToken"] ),
"Char": ( traits: ["AstToken"] ),
2019-01-14 12:30:21 -06:00
"TrueKw": ( traits: ["AstToken"] ),
"FalseKw": ( traits: ["AstToken"] ),
"LiteralExpr": (
enum: [
"String",
"ByteString",
"Char",
"Byte",
"IntNumber",
"FloatNumber",
2019-01-14 12:30:21 -06:00
"TrueKw",
"FalseKw",
]
),
2019-01-14 12:30:21 -06:00
"Literal": (options: ["LiteralExpr"]),
2018-08-25 05:42:40 -05:00
"Expr": (
enum: [
"TupleExpr",
"ArrayExpr",
"ParenExpr",
"PathExpr",
"LambdaExpr",
"IfExpr",
"LoopExpr",
"ForExpr",
"WhileExpr",
"ContinueExpr",
"BreakExpr",
"Label",
"BlockExpr",
"ReturnExpr",
"MatchExpr",
"StructLit",
"CallExpr",
"IndexExpr",
"MethodCallExpr",
"FieldExpr",
"TryExpr",
"CastExpr",
"RefExpr",
"PrefixExpr",
"RangeExpr",
"BinExpr",
2019-01-14 12:30:21 -06:00
"Literal",
2018-08-25 05:42:40 -05:00
],
),
2019-01-13 04:34:57 -06:00
"RefPat": ( options: [ "Pat" ]),
2018-08-26 04:09:28 -05:00
"BindPat": ( traits: ["NameOwner"] ),
"PlaceholderPat": (),
"PathPat": (),
"StructPat": (),
"FieldPatList": (),
"TupleStructPat": (
options: ["Path"],
collections: [["args", "Pat"]],
),
2018-08-26 04:09:28 -05:00
"TuplePat": (),
"SlicePat": (),
"RangePat": (),
"Pat": (
enum: [
"RefPat",
"BindPat",
"PlaceholderPat",
"PathPat",
"StructPat",
"FieldPatList",
"TupleStructPat",
"TuplePat",
"SlicePat",
"RangePat",
],
),
2019-01-03 04:47:28 -06:00
"Visibility": (),
2018-08-22 08:46:42 -05:00
"Name": (),
"NameRef": (),
2018-12-28 07:59:58 -06:00
"MacroCall": ( options: [ "TokenTree", "Path" ] ),
2018-08-22 08:46:42 -05:00
"Attr": ( options: [ ["value", "TokenTree"] ] ),
"TokenTree": (),
2018-08-28 15:59:57 -05:00
"TypeParamList": (
collections: [
["type_params", "TypeParam" ],
["lifetime_params", "LifetimeParam" ],
]
),
2018-08-26 04:09:28 -05:00
"TypeParam": ( traits: ["NameOwner"] ),
2018-08-31 07:10:37 -05:00
"LifetimeParam": ( options: [ "Lifetime" ] ),
2019-01-08 03:23:10 -06:00
"Lifetime": ( traits: ["AstToken"] ),
2018-08-22 08:46:42 -05:00
"WhereClause": (),
2018-08-27 04:22:09 -05:00
"ExprStmt": (
options: [ ["expr", "Expr"] ]
),
2018-08-27 02:01:31 -05:00
"LetStmt": ( options: [
["pat", "Pat"],
2018-12-23 06:22:29 -06:00
["type_ref", "TypeRef"],
2018-08-27 02:01:31 -05:00
["initializer", "Expr"],
]),
2018-08-27 04:22:09 -05:00
"Condition": (
2018-08-31 07:10:37 -05:00
options: [ "Pat", "Expr" ]
2018-08-27 04:22:09 -05:00
),
2018-08-27 02:12:28 -05:00
"Stmt": (
enum: ["ExprStmt", "LetStmt"],
),
2018-08-26 04:09:28 -05:00
"Block": (
2018-08-31 07:10:37 -05:00
options: [ "Expr" ],
2018-08-26 04:09:28 -05:00
collections: [
2018-08-27 02:12:28 -05:00
["statements", "Stmt"],
2018-08-26 04:09:28 -05:00
]
),
"ParamList": (
2018-08-31 08:30:42 -05:00
options: [ "SelfParam" ],
2018-08-26 04:09:28 -05:00
collections: [
["params", "Param"]
]
),
2018-12-29 14:32:07 -06:00
"SelfParam": (options: ["TypeRef", "SelfKw"]),
"SelfKw": (),
2018-08-26 04:09:28 -05:00
"Param": (
2018-12-20 14:56:28 -06:00
options: [ "Pat", "TypeRef" ],
2018-08-28 03:12:42 -05:00
),
2018-08-30 12:37:33 -05:00
"UseItem": (
2018-08-31 07:10:37 -05:00
options: [ "UseTree" ]
2018-08-30 12:37:33 -05:00
),
"UseTree": (
2018-08-31 07:10:37 -05:00
options: [ "Path", "UseTreeList" ]
2018-08-30 12:37:33 -05:00
),
"UseTreeList": (
collections: [["use_trees", "UseTree"]]
),
2018-08-28 03:12:42 -05:00
"ExternCrateItem": (),
2018-08-28 15:59:57 -05:00
"ArgList": (
collections: [
["args", "Expr"]
]
2018-08-30 12:03:18 -05:00
),
2018-08-30 12:37:33 -05:00
"Path": (
options: [
2018-10-24 10:37:25 -05:00
["segment", "PathSegment"],
["qualifier", "Path"],
2018-08-30 12:37:33 -05:00
]
),
"PathSegment": (
2018-08-31 07:10:37 -05:00
options: [ "NameRef" ]
2018-08-30 12:37:33 -05:00
),
2019-01-08 03:23:10 -06:00
"Comment": ( traits: ["AstToken"] ),
"Whitespace": ( traits: ["AstToken"] ),
2018-08-11 02:11:58 -05:00
},
2018-01-28 09:53:53 -06:00
)