From b097090690f5edbe03f4aa9d042ba26c123699e4 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 11 Feb 2018 00:46:17 +0300 Subject: G: more types --- .../parser/inline/0014_type_item_type_params.txt | 7 ++++--- tests/data/parser/inline/0015_type_item.txt | 8 ++++++-- .../parser/inline/0016_type_item_where_clause.txt | 7 ++++--- tests/data/parser/inline/0017_paren_type.rs | 1 + tests/data/parser/inline/0017_paren_type.txt | 19 +++++++++++++++++++ tests/data/parser/inline/0018_unit_type.rs | 1 + tests/data/parser/inline/0018_unit_type.txt | 14 ++++++++++++++ .../data/parser/inline/0019_singleton_tuple_type.rs | 1 + .../data/parser/inline/0019_singleton_tuple_type.txt | 20 ++++++++++++++++++++ 9 files changed, 70 insertions(+), 8 deletions(-) create mode 100644 tests/data/parser/inline/0017_paren_type.rs create mode 100644 tests/data/parser/inline/0017_paren_type.txt create mode 100644 tests/data/parser/inline/0018_unit_type.rs create mode 100644 tests/data/parser/inline/0018_unit_type.txt create mode 100644 tests/data/parser/inline/0019_singleton_tuple_type.rs create mode 100644 tests/data/parser/inline/0019_singleton_tuple_type.txt (limited to 'tests/data/parser/inline') diff --git a/tests/data/parser/inline/0014_type_item_type_params.txt b/tests/data/parser/inline/0014_type_item_type_params.txt index ca32faa42..98a71414e 100644 --- a/tests/data/parser/inline/0014_type_item_type_params.txt +++ b/tests/data/parser/inline/0014_type_item_type_params.txt @@ -11,8 +11,9 @@ FILE@[0; 21) R_ANGLE@[13; 14) WHITESPACE@[14; 15) EQ@[15; 16) - WHITESPACE@[16; 17) - L_PAREN@[17; 18) - R_PAREN@[18; 19) + TUPLE_TYPE@[16; 19) + 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.txt b/tests/data/parser/inline/0015_type_item.txt index 3818fe25d..602298546 100644 --- a/tests/data/parser/inline/0015_type_item.txt +++ b/tests/data/parser/inline/0015_type_item.txt @@ -6,7 +6,11 @@ FILE@[0; 16) IDENT@[5; 8) "Foo" WHITESPACE@[8; 9) EQ@[9; 10) - WHITESPACE@[10; 11) - IDENT@[11; 14) "Bar" + PATH_TYPE@[10; 14) + PATH@[10; 14) + PATH_SEGMENT@[10; 14) + NAME_REF@[10; 14) + 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.txt b/tests/data/parser/inline/0016_type_item_where_clause.txt index 12bbc752a..ff20c6255 100644 --- a/tests/data/parser/inline/0016_type_item_where_clause.txt +++ b/tests/data/parser/inline/0016_type_item_where_clause.txt @@ -14,8 +14,9 @@ FILE@[0; 31) IDENT@[20; 24) "Copy" WHITESPACE@[24; 25) EQ@[25; 26) - WHITESPACE@[26; 27) - L_PAREN@[27; 28) - R_PAREN@[28; 29) + TUPLE_TYPE@[26; 29) + WHITESPACE@[26; 27) + L_PAREN@[27; 28) + R_PAREN@[28; 29) SEMI@[29; 30) WHITESPACE@[30; 31) diff --git a/tests/data/parser/inline/0017_paren_type.rs b/tests/data/parser/inline/0017_paren_type.rs new file mode 100644 index 000000000..6e1b25101 --- /dev/null +++ b/tests/data/parser/inline/0017_paren_type.rs @@ -0,0 +1 @@ +type T = (i32); diff --git a/tests/data/parser/inline/0017_paren_type.txt b/tests/data/parser/inline/0017_paren_type.txt new file mode 100644 index 000000000..6ef9c9190 --- /dev/null +++ b/tests/data/parser/inline/0017_paren_type.txt @@ -0,0 +1,19 @@ +FILE@[0; 16) + TYPE_ITEM@[0; 16) + TYPE_KW@[0; 4) + NAME@[4; 7) + WHITESPACE@[4; 5) + IDENT@[5; 6) "T" + WHITESPACE@[6; 7) + EQ@[7; 8) + PAREN_TYPE@[8; 14) + WHITESPACE@[8; 9) + L_PAREN@[9; 10) + PATH_TYPE@[10; 13) + PATH@[10; 13) + PATH_SEGMENT@[10; 13) + NAME_REF@[10; 13) + IDENT@[10; 13) "i32" + R_PAREN@[13; 14) + SEMI@[14; 15) + WHITESPACE@[15; 16) diff --git a/tests/data/parser/inline/0018_unit_type.rs b/tests/data/parser/inline/0018_unit_type.rs new file mode 100644 index 000000000..c039cf7d3 --- /dev/null +++ b/tests/data/parser/inline/0018_unit_type.rs @@ -0,0 +1 @@ +type T = (); diff --git a/tests/data/parser/inline/0018_unit_type.txt b/tests/data/parser/inline/0018_unit_type.txt new file mode 100644 index 000000000..707b6e53e --- /dev/null +++ b/tests/data/parser/inline/0018_unit_type.txt @@ -0,0 +1,14 @@ +FILE@[0; 13) + TYPE_ITEM@[0; 13) + TYPE_KW@[0; 4) + NAME@[4; 7) + WHITESPACE@[4; 5) + IDENT@[5; 6) "T" + WHITESPACE@[6; 7) + EQ@[7; 8) + TUPLE_TYPE@[8; 11) + WHITESPACE@[8; 9) + L_PAREN@[9; 10) + R_PAREN@[10; 11) + SEMI@[11; 12) + WHITESPACE@[12; 13) diff --git a/tests/data/parser/inline/0019_singleton_tuple_type.rs b/tests/data/parser/inline/0019_singleton_tuple_type.rs new file mode 100644 index 000000000..cb66bad24 --- /dev/null +++ b/tests/data/parser/inline/0019_singleton_tuple_type.rs @@ -0,0 +1 @@ +type T = (i32,); diff --git a/tests/data/parser/inline/0019_singleton_tuple_type.txt b/tests/data/parser/inline/0019_singleton_tuple_type.txt new file mode 100644 index 000000000..cca96e7ea --- /dev/null +++ b/tests/data/parser/inline/0019_singleton_tuple_type.txt @@ -0,0 +1,20 @@ +FILE@[0; 17) + TYPE_ITEM@[0; 17) + TYPE_KW@[0; 4) + NAME@[4; 7) + WHITESPACE@[4; 5) + IDENT@[5; 6) "T" + WHITESPACE@[6; 7) + EQ@[7; 8) + TUPLE_TYPE@[8; 15) + WHITESPACE@[8; 9) + L_PAREN@[9; 10) + PATH_TYPE@[10; 13) + PATH@[10; 13) + PATH_SEGMENT@[10; 13) + NAME_REF@[10; 13) + IDENT@[10; 13) "i32" + COMMA@[13; 14) + R_PAREN@[14; 15) + SEMI@[15; 16) + WHITESPACE@[16; 17) -- cgit v1.2.3