From 2ef16a4121ad497e7fb290445ffe644b6b8ceae6 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 10 Feb 2018 12:35:40 +0300 Subject: G: type item --- tests/data/lexer/0011_keywords.rs | 2 +- tests/data/lexer/0011_keywords.txt | 2 ++ .../data/parser/inline/0014_type_item_type_params.rs | 1 + .../data/parser/inline/0014_type_item_type_params.txt | 17 +++++++++++++++++ tests/data/parser/inline/0015_type_item.rs | 1 + tests/data/parser/inline/0015_type_item.txt | 11 +++++++++++ .../data/parser/inline/0016_type_item_where_clause.rs | 1 + .../parser/inline/0016_type_item_where_clause.txt | 19 +++++++++++++++++++ 8 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 tests/data/parser/inline/0014_type_item_type_params.rs create mode 100644 tests/data/parser/inline/0014_type_item_type_params.txt create mode 100644 tests/data/parser/inline/0015_type_item.rs create mode 100644 tests/data/parser/inline/0015_type_item.txt create mode 100644 tests/data/parser/inline/0016_type_item_where_clause.rs create mode 100644 tests/data/parser/inline/0016_type_item_where_clause.txt (limited to 'tests/data') diff --git a/tests/data/lexer/0011_keywords.rs b/tests/data/lexer/0011_keywords.rs index b74fc606e..7a9509f3c 100644 --- a/tests/data/lexer/0011_keywords.rs +++ b/tests/data/lexer/0011_keywords.rs @@ -1,3 +1,3 @@ fn use struct trait enum impl true false as extern crate mod pub self super in where for loop while if match const -static mut +static mut type diff --git a/tests/data/lexer/0011_keywords.txt b/tests/data/lexer/0011_keywords.txt index 05b1f0995..96528952b 100644 --- a/tests/data/lexer/0011_keywords.txt +++ b/tests/data/lexer/0011_keywords.txt @@ -47,4 +47,6 @@ WHITESPACE 1 "\n" STATIC_KW 6 "static" WHITESPACE 1 " " MUT_KW 3 "mut" +WHITESPACE 1 " " +TYPE_KW 4 "type" WHITESPACE 1 "\n" diff --git a/tests/data/parser/inline/0014_type_item_type_params.rs b/tests/data/parser/inline/0014_type_item_type_params.rs new file mode 100644 index 000000000..defd110c4 --- /dev/null +++ b/tests/data/parser/inline/0014_type_item_type_params.rs @@ -0,0 +1 @@ +type Result = (); diff --git a/tests/data/parser/inline/0014_type_item_type_params.txt b/tests/data/parser/inline/0014_type_item_type_params.txt new file mode 100644 index 000000000..b0f0f8337 --- /dev/null +++ b/tests/data/parser/inline/0014_type_item_type_params.txt @@ -0,0 +1,17 @@ +FILE@[0; 21) + TYPE_ITEM@[0; 21) + TYPE_KW@[0; 4) + WHITESPACE@[4; 5) + IDENT@[5; 11) "Result" + TYPE_PARAM_LIST@[11; 15) + L_ANGLE@[11; 12) + TYPE_PARAM@[12; 13) + IDENT@[12; 13) "T" + R_ANGLE@[13; 14) + WHITESPACE@[14; 15) + EQ@[15; 16) + WHITESPACE@[16; 17) + L_PAREN@[17; 18) + R_PAREN@[18; 19) + SEMI@[19; 20) + WHITESPACE@[20; 21) diff --git a/tests/data/parser/inline/0015_type_item.rs b/tests/data/parser/inline/0015_type_item.rs new file mode 100644 index 000000000..04c0344fa --- /dev/null +++ b/tests/data/parser/inline/0015_type_item.rs @@ -0,0 +1 @@ +type Foo = Bar; diff --git a/tests/data/parser/inline/0015_type_item.txt b/tests/data/parser/inline/0015_type_item.txt new file mode 100644 index 000000000..382d7ece0 --- /dev/null +++ b/tests/data/parser/inline/0015_type_item.txt @@ -0,0 +1,11 @@ +FILE@[0; 16) + TYPE_ITEM@[0; 16) + TYPE_KW@[0; 4) + WHITESPACE@[4; 5) + IDENT@[5; 8) "Foo" + WHITESPACE@[8; 9) + EQ@[9; 10) + WHITESPACE@[10; 11) + IDENT@[11; 14) "Bar" + SEMI@[14; 15) + WHITESPACE@[15; 16) diff --git a/tests/data/parser/inline/0016_type_item_where_clause.rs b/tests/data/parser/inline/0016_type_item_where_clause.rs new file mode 100644 index 000000000..a602d07f0 --- /dev/null +++ b/tests/data/parser/inline/0016_type_item_where_clause.rs @@ -0,0 +1 @@ +type Foo where Foo: Copy = (); diff --git a/tests/data/parser/inline/0016_type_item_where_clause.txt b/tests/data/parser/inline/0016_type_item_where_clause.txt new file mode 100644 index 000000000..28fcc7c0a --- /dev/null +++ b/tests/data/parser/inline/0016_type_item_where_clause.txt @@ -0,0 +1,19 @@ +FILE@[0; 31) + TYPE_ITEM@[0; 31) + TYPE_KW@[0; 4) + WHITESPACE@[4; 5) + IDENT@[5; 8) "Foo" + WHITESPACE@[8; 9) + WHERE_KW@[9; 14) + WHITESPACE@[14; 15) + IDENT@[15; 18) "Foo" + COLON@[18; 19) + WHITESPACE@[19; 20) + IDENT@[20; 24) "Copy" + WHITESPACE@[24; 25) + EQ@[25; 26) + WHITESPACE@[26; 27) + L_PAREN@[27; 28) + R_PAREN@[28; 29) + SEMI@[29; 30) + WHITESPACE@[30; 31) -- cgit v1.2.3