rust/src/grammar.ron

201 lines
3.8 KiB
Plaintext
Raw Normal View History

2017-12-29 01:21:54 +03:00
Grammar(
2018-07-30 17:46:50 +03: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"],
["&", "AMPERSAND"],
["|", "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 16:09:25 +03:00
["<=", "LTEQ"],
[">=", "GTEQ"],
["+=", "PLUSEQ"],
["-=", "MINUSEQ"],
2018-07-30 17:46:50 +03:00
],
2018-01-01 18:58:46 +03:00
keywords: [
"use",
"fn",
"struct",
"enum",
"trait",
"impl",
2018-01-08 21:21:59 +03:00
"true",
"false",
2018-01-09 00:06:42 +03:00
"as",
"extern",
"crate",
2018-01-09 22:35:55 +03:00
"mod",
2018-01-12 22:05:46 +03:00
"pub",
"self",
"super",
2018-01-13 11:55:03 +03:00
"in",
2018-01-13 22:00:26 +03:00
"where",
2018-01-30 22:53:19 +03:00
"for",
"loop",
"while",
"if",
2018-08-01 00:14:26 +03:00
"else",
2018-02-02 23:30:17 +03:00
"match",
"const",
"static",
2018-02-02 23:45:15 +03:00
"mut",
2018-02-03 12:05:25 +03:00
"unsafe",
2018-02-10 12:35:40 +03:00
"type",
"ref",
"let",
2018-08-01 00:30:17 +03:00
"move",
2018-08-01 11:27:31 +03:00
"return",
2018-01-01 18:58:46 +03:00
],
2018-02-04 16:46:26 +03:00
contextual_keywords: [
"auto",
"default",
"union",
],
2017-12-31 23:27:36 +03:00
tokens: [
2017-12-30 00:48:47 +03:00
"ERROR",
2017-12-29 01:21:54 +03:00
"IDENT",
2017-12-30 00:48:47 +03:00
"UNDERSCORE",
2017-12-29 01:21:54 +03:00
"WHITESPACE",
2017-12-30 15:22:40 +03:00
"INT_NUMBER",
"FLOAT_NUMBER",
2017-12-31 10:41:42 +03:00
"LIFETIME",
2017-12-31 14:02:55 +03:00
"CHAR",
"BYTE",
"STRING",
"RAW_STRING",
"BYTE_STRING",
"RAW_BYTE_STRING",
2017-12-31 16:42:22 +03:00
"COMMENT",
"DOC_COMMENT",
"SHEBANG",
2017-12-31 23:27:36 +03:00
],
nodes: [
2018-01-01 18:58:46 +03:00
"FILE",
2018-02-02 22:08:14 +03:00
2018-01-06 17:16:00 +03:00
"STRUCT_ITEM",
2018-01-28 22:59:18 +03:00
"ENUM_ITEM",
2018-01-07 16:01:30 +03:00
"FN_ITEM",
2018-01-09 00:06:42 +03:00
"EXTERN_CRATE_ITEM",
2018-01-09 22:35:55 +03:00
"MOD_ITEM",
2018-01-09 23:32:18 +03:00
"USE_ITEM",
2018-02-02 23:45:15 +03:00
"STATIC_ITEM",
2018-02-03 12:05:25 +03:00
"CONST_ITEM",
2018-02-04 13:39:24 +03:00
"TRAIT_ITEM",
"IMPL_ITEM",
2018-02-10 12:35:40 +03:00
"TYPE_ITEM",
2018-08-05 14:08:46 +03:00
"MACRO_CALL",
"TOKEN_TREE",
2018-02-02 22:08:14 +03:00
2018-02-11 00:46:17 +03:00
"PAREN_TYPE",
"TUPLE_TYPE",
"NEVER_TYPE",
"PATH_TYPE",
2018-02-11 11:19:54 +03:00
"POINTER_TYPE",
2018-02-11 11:37:08 +03:00
"ARRAY_TYPE",
"SLICE_TYPE",
2018-02-11 11:54:09 +03:00
"REFERENCE_TYPE",
2018-02-11 11:57:05 +03:00
"PLACEHOLDER_TYPE",
2018-02-11 12:51:09 +03:00
"FN_POINTER_TYPE",
2018-02-11 23:32:49 +03:00
"FOR_TYPE",
2018-07-31 22:41:29 +03:00
"IMPL_TRAIT_TYPE",
2018-02-11 00:46:17 +03:00
"REF_PAT",
"BIND_PAT",
"PLACEHOLDER_PAT",
2018-08-04 15:47:45 +03:00
"PATH_PAT",
"STRUCT_PAT",
"TUPLE_PAT",
2018-08-04 16:34:54 +03:00
// atoms
"TUPLE_EXPR",
2018-07-30 17:02:51 +03:00
"PATH_EXPR",
2018-07-31 23:13:08 +03:00
"LAMBDA_EXPR",
2018-08-01 00:14:26 +03:00
"IF_EXPR",
2018-08-05 01:03:22 +03:00
"WHILE_EXPR",
2018-08-01 11:27:31 +03:00
"BLOCK_EXPR",
"RETURN_EXPR",
2018-08-04 13:39:03 +03:00
"MATCH_EXPR",
"MATCH_ARM",
"MATCH_GUARD",
2018-08-04 16:34:54 +03:00
"STRUCT_LIT",
"STRUCT_LIT_FIELD",
// postfix
"CALL_EXPR",
"METHOD_CALL_EXPR",
"FIELD_EXPR",
"TRY_EXPR",
// unary
"REF_EXPR",
"DEREF_EXPR",
"NOT_EXPR",
"BIN_EXPR",
2018-08-01 10:51:42 +03:00
"EXTERN_BLOCK_EXPR",
2018-02-02 22:08:14 +03:00
"ENUM_VARIANT",
"NAMED_FIELD",
"POS_FIELD",
"ATTR",
"META_ITEM", // not an item actually
2018-01-13 13:42:19 +03:00
"USE_TREE",
2018-01-09 23:32:18 +03:00
"PATH",
"PATH_SEGMENT",
2018-01-08 21:40:00 +03:00
"LITERAL",
2018-01-09 00:06:42 +03:00
"ALIAS",
2018-01-12 22:05:46 +03:00
"VISIBILITY",
2018-02-10 12:53:07 +03:00
"WHERE_CLAUSE",
2018-02-02 22:08:14 +03:00
"ABI",
2018-02-10 14:00:23 +03:00
"NAME",
"NAME_REF",
2018-07-31 12:59:52 +03:00
"LET_STMT",
2018-07-31 12:59:52 +03:00
"EXPR_STMT",
2018-07-30 17:02:51 +03:00
"TYPE_PARAM_LIST",
2018-07-31 19:37:40 +03:00
"LIFETIME_PARAM",
"TYPE_PARAM",
2018-07-30 17:02:51 +03:00
"TYPE_ARG_LIST",
2018-07-31 19:37:40 +03:00
"LIFETIME_ARG",
"TYPE_ARG",
"ASSOC_TYPE_ARG",
2018-07-31 12:32:53 +03:00
"PARAM_LIST",
2018-07-31 23:13:55 +03:00
"PARAM",
2018-07-31 18:03:50 +03:00
"SELF_PARAM",
2018-07-31 12:32:53 +03:00
"ARG_LIST",
2017-12-29 01:21:54 +03:00
]
2018-01-28 18:53:53 +03:00
)