From eba1e8a334a707645701db48fddc61acad7b2dbc Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 31 Jul 2018 19:58:12 +0300 Subject: function type params --- .../parser/inline/0059_fn_item_where_clause.rs | 1 + .../parser/inline/0059_fn_item_where_clause.txt | 28 +++++++++++++++++++ .../data/parser/inline/0060_fn_item_type_params.rs | 1 + .../parser/inline/0060_fn_item_type_params.txt | 32 ++++++++++++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 tests/data/parser/inline/0059_fn_item_where_clause.rs create mode 100644 tests/data/parser/inline/0059_fn_item_where_clause.txt create mode 100644 tests/data/parser/inline/0060_fn_item_type_params.rs create mode 100644 tests/data/parser/inline/0060_fn_item_type_params.txt (limited to 'tests/data/parser/inline') diff --git a/tests/data/parser/inline/0059_fn_item_where_clause.rs b/tests/data/parser/inline/0059_fn_item_where_clause.rs new file mode 100644 index 000000000..f0920b2a8 --- /dev/null +++ b/tests/data/parser/inline/0059_fn_item_where_clause.rs @@ -0,0 +1 @@ +fn foo() where T: Copy {} diff --git a/tests/data/parser/inline/0059_fn_item_where_clause.txt b/tests/data/parser/inline/0059_fn_item_where_clause.txt new file mode 100644 index 000000000..c904d171f --- /dev/null +++ b/tests/data/parser/inline/0059_fn_item_where_clause.txt @@ -0,0 +1,28 @@ +FILE@[0; 29) + FN_ITEM@[0; 29) + FN_KW@[0; 2) + NAME@[2; 6) + WHITESPACE@[2; 3) + IDENT@[3; 6) "foo" + TYPE_PARAM_LIST@[6; 9) + L_ANGLE@[6; 7) + TYPE_PARAM@[7; 8) + NAME@[7; 8) + IDENT@[7; 8) "T" + R_ANGLE@[8; 9) + PARAM_LIST@[9; 12) + L_PAREN@[9; 10) + R_PAREN@[10; 11) + WHITESPACE@[11; 12) + WHERE_CLAUSE@[12; 26) + WHERE_KW@[12; 17) + WHITESPACE@[17; 18) + IDENT@[18; 19) "T" + COLON@[19; 20) + WHITESPACE@[20; 21) + IDENT@[21; 25) "Copy" + WHITESPACE@[25; 26) + BLOCK@[26; 29) + L_CURLY@[26; 27) + R_CURLY@[27; 28) + WHITESPACE@[28; 29) diff --git a/tests/data/parser/inline/0060_fn_item_type_params.rs b/tests/data/parser/inline/0060_fn_item_type_params.rs new file mode 100644 index 000000000..9df40ed39 --- /dev/null +++ b/tests/data/parser/inline/0060_fn_item_type_params.rs @@ -0,0 +1 @@ +fn foo(){} diff --git a/tests/data/parser/inline/0060_fn_item_type_params.txt b/tests/data/parser/inline/0060_fn_item_type_params.txt new file mode 100644 index 000000000..0b0f8352b --- /dev/null +++ b/tests/data/parser/inline/0060_fn_item_type_params.txt @@ -0,0 +1,32 @@ +FILE@[0; 28) + FN_ITEM@[0; 28) + FN_KW@[0; 2) + NAME@[2; 6) + WHITESPACE@[2; 3) + IDENT@[3; 6) "foo" + TYPE_PARAM_LIST@[6; 23) + L_ANGLE@[6; 7) + TYPE_PARAM@[7; 22) + NAME@[7; 8) + IDENT@[7; 8) "T" + COLON@[8; 9) + PATH@[9; 16) + PATH_SEGMENT@[9; 16) + NAME_REF@[9; 16) + WHITESPACE@[9; 10) + IDENT@[10; 15) "Clone" + WHITESPACE@[15; 16) + PLUS@[16; 17) + PATH@[17; 22) + PATH_SEGMENT@[17; 22) + NAME_REF@[17; 22) + WHITESPACE@[17; 18) + IDENT@[18; 22) "Copy" + R_ANGLE@[22; 23) + PARAM_LIST@[23; 25) + L_PAREN@[23; 24) + R_PAREN@[24; 25) + BLOCK@[25; 28) + L_CURLY@[25; 26) + R_CURLY@[26; 27) + WHITESPACE@[27; 28) -- cgit v1.2.3