From afa94d4f37b9a0a1e723edffcc79c3d48799bad1 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 9 Aug 2018 17:44:40 +0300 Subject: [PATCH] fn_item -> function --- docs/TESTS.md | 10 +++++----- libeditor/src/lib.rs | 2 +- src/ast/generated.rs | 6 +++--- src/ast/mod.rs | 6 +++--- src/grammar.ron | 4 ++-- src/grammar/items/mod.rs | 12 ++++++------ src/grammar/mod.rs | 2 +- src/syntax_kinds/generated.rs | 4 ++-- tests/data/parser/err/0005_attribute_recover.txt | 4 ++-- tests/data/parser/err/0007_stray_curly_in_file.txt | 2 +- tests/data/parser/err/0008_item_block_recovery.txt | 4 ++-- tests/data/parser/err/0010_unsafe_lambda_block.txt | 2 +- tests/data/parser/err/0012_broken_lambda.txt | 2 +- tests/data/parser/inline/0001_const_unsafe_fn.txt | 2 +- tests/data/parser/inline/0002_const_fn.txt | 2 +- tests/data/parser/inline/0004_extern_fn.txt | 2 +- tests/data/parser/inline/0011_unsafe_fn.txt | 2 +- tests/data/parser/inline/0012_unsafe_extern_fn.txt | 2 +- .../data/parser/inline/0013_unsafe_block_in_mod.txt | 4 ++-- tests/data/parser/inline/0034_bind_pat.txt | 2 +- tests/data/parser/inline/0035_ref_pat.txt | 2 +- tests/data/parser/inline/0036_placeholder_pat.txt | 2 +- ...fn_item_ret_type.rs => 0038_function_ret_type.rs} | 0 ..._item_ret_type.txt => 0038_function_ret_type.txt} | 4 ++-- tests/data/parser/inline/0039_path_expr.txt | 2 +- tests/data/parser/inline/0040_expr_literals.txt | 2 +- tests/data/parser/inline/0043_call_expr.txt | 2 +- tests/data/parser/inline/0044_ref_expr.txt | 2 +- tests/data/parser/inline/0045_block.txt | 8 ++++---- tests/data/parser/inline/0050_let_stmt;.txt | 2 +- tests/data/parser/inline/0051_method_call_expr.txt | 2 +- tests/data/parser/inline/0052_field_expr.txt | 2 +- tests/data/parser/inline/0053_block_items.txt | 4 ++-- tests/data/parser/inline/0054_impl_item_items.txt | 4 ++-- tests/data/parser/inline/0055_self_param.txt | 8 ++++---- ...where_clause.rs => 0059_function_where_clause.rs} | 0 ...ere_clause.txt => 0059_function_where_clause.txt} | 2 +- ...m_type_params.rs => 0060_function_type_params.rs} | 0 ...type_params.txt => 0060_function_type_params.txt} | 2 +- tests/data/parser/inline/0061_struct_lit.txt | 2 +- tests/data/parser/inline/0063_lambda_expr.txt | 2 +- tests/data/parser/inline/0064_param_list.txt | 8 ++++---- tests/data/parser/inline/0065_if_expr.txt | 2 +- tests/data/parser/inline/0066_lambda_expr.txt | 2 +- tests/data/parser/inline/0067_block_expr.txt | 2 +- tests/data/parser/inline/0068_pub_expr.txt | 2 +- tests/data/parser/inline/0068_return_expr.txt | 2 +- tests/data/parser/inline/0069_match_arm.txt | 2 +- tests/data/parser/inline/0070_match_expr.txt | 2 +- tests/data/parser/inline/0071_tuple_pat_fields.txt | 2 +- tests/data/parser/inline/0072_path_part.txt | 2 +- tests/data/parser/inline/0073_struct_pat_fields.txt | 2 +- tests/data/parser/inline/0074_unary_expr.txt | 2 +- tests/data/parser/inline/0075_try_expr.txt | 2 +- tests/data/parser/inline/0076_cond.txt | 2 +- tests/data/parser/inline/0077_while_expr.txt | 2 +- tests/data/parser/inline/0078_mod_contents.txt | 2 +- tests/data/parser/inline/0079_cast_expr.txt | 2 +- tests/data/parser/inline/0080_tuple_expr.txt | 2 +- tests/data/parser/inline/0081_index_expr.txt | 2 +- tests/data/parser/inline/0082_tuple_pat.txt | 2 +- tests/data/parser/inline/0083_postfix_range.txt | 2 +- tests/data/parser/inline/0084_loop_expr.txt | 2 +- tests/data/parser/inline/0085_for_expr.txt | 2 +- tests/data/parser/inline/0085_match_arms_commas.txt | 2 +- tests/data/parser/inline/0086_array_expr.txt | 2 +- .../data/parser/inline/0086_no_semi_after_block.txt | 2 +- .../inline/0087_stmt_postfix_expr_ambiguity.txt | 2 +- .../parser/inline/0088_stmt_bin_expr_ambiguity.txt | 2 +- tests/data/parser/inline/0089_slice_pat.txt | 2 +- tests/data/parser/inline/0090_trait_item_items.txt | 4 ++-- tests/data/parser/inline/0091_fn_decl.txt | 2 +- tests/data/parser/inline/0092_literal_pattern.txt | 2 +- tests/data/parser/inline/0094_range_pat.txt | 2 +- .../parser/inline/0095_path_type_with_bounds.txt | 2 +- .../parser/inline/0097_param_list_opt_patterns.txt | 2 +- tests/data/parser/inline/0098_where_clause.txt | 2 +- tests/data/parser/inline/0099_crate_keyword_vis.txt | 2 +- tests/data/parser/ok/0005_fn_item.txt | 2 +- tests/data/parser/ok/0008_mod_item.txt | 2 +- tests/data/parser/ok/0011_outer_attribute.txt | 2 +- tests/data/parser/ok/0012_visibility.txt | 10 +++++----- tests/data/parser/ok/0017_attr_trailing_comma.txt | 2 +- tests/data/parser/ok/0021_extern_fn.txt | 6 +++--- tests/data/parser/ok/0025_extern_fn_in_block.txt | 4 ++-- tests/data/parser/ok/0026_const_fn_in_block.txt | 4 ++-- tests/data/parser/ok/0027_unsafe_fn_in_block.txt | 4 ++-- tests/data/parser/ok/0028_operator_binding_power.txt | 2 +- tests/data/parser/ok/0029_range_forms.txt | 2 +- 89 files changed, 126 insertions(+), 126 deletions(-) rename tests/data/parser/inline/{0038_fn_item_ret_type.rs => 0038_function_ret_type.rs} (100%) rename tests/data/parser/inline/{0038_fn_item_ret_type.txt => 0038_function_ret_type.txt} (94%) rename tests/data/parser/inline/{0059_fn_item_where_clause.rs => 0059_function_where_clause.rs} (100%) rename tests/data/parser/inline/{0059_fn_item_where_clause.txt => 0059_function_where_clause.txt} (97%) rename tests/data/parser/inline/{0060_fn_item_type_params.rs => 0060_function_type_params.rs} (100%) rename tests/data/parser/inline/{0060_fn_item_type_params.txt => 0060_function_type_params.txt} (97%) diff --git a/docs/TESTS.md b/docs/TESTS.md index db06dbebc9..a9d32d1d41 100644 --- a/docs/TESTS.md +++ b/docs/TESTS.md @@ -24,20 +24,20 @@ recovery and it is totally ok for a parser to not implement any error recovery at all. However, for libsyntax2.0 we do care about error recovery, and we do care about precise and useful error messages. -There are also so-called "inline tests". They appear as the comments +There are also so-called "inline tests". They appear as the comments with a `test` header in the source code, like this: ```rust // test fn_basic // fn foo() {} -fn fn_item(p: &mut Parser) { +fn function(p: &mut Parser) { // ... } -``` +``` -You can run `cargo collect-tests` command to collect all inline tests +You can run `cargo collect-tests` command to collect all inline tests into `tests/data/inline` directory. The main advantage of inline tests -is that they help to illustrate what the relevant code is doing. +is that they help to illustrate what the relevant code is doing. Contribution opportunity: design and implement testing infrastructure diff --git a/libeditor/src/lib.rs b/libeditor/src/lib.rs index e7cc6a696e..ebc063ed21 100644 --- a/libeditor/src/lib.rs +++ b/libeditor/src/lib.rs @@ -120,7 +120,7 @@ struct Declaration<'f>(SyntaxNodeRef<'f>); impl<'f> Declaration<'f> { fn cast(node: SyntaxNodeRef<'f>) -> Option> { match node.kind() { - | STRUCT_ITEM | ENUM_ITEM | FN_ITEM | TRAIT_ITEM + | STRUCT_ITEM | ENUM_ITEM | FUNCTION | TRAIT_ITEM | CONST_ITEM | STATIC_ITEM | MOD_ITEM | NAMED_FIELD | TYPE_ITEM => Some(Declaration(node)), _ => None diff --git a/src/ast/generated.rs b/src/ast/generated.rs index 612b04f867..b93c76d0cc 100644 --- a/src/ast/generated.rs +++ b/src/ast/generated.rs @@ -22,14 +22,14 @@ impl AstNode for File { #[derive(Debug)] -pub struct FnItem> { +pub struct Function> { syntax: SyntaxNode, } -impl AstNode for FnItem { +impl AstNode for Function { fn cast(syntax: SyntaxNode) -> Option { match syntax.kind() { - FN_ITEM => Some(FnItem { syntax }), + FUNCTION => Some(Function { syntax }), _ => None, } } diff --git a/src/ast/mod.rs b/src/ast/mod.rs index dc7e006c94..317ed4f453 100644 --- a/src/ast/mod.rs +++ b/src/ast/mod.rs @@ -19,14 +19,14 @@ impl File> { } impl File { - pub fn functions<'a>(&'a self) -> impl Iterator> + 'a { + pub fn functions<'a>(&'a self) -> impl Iterator> + 'a { self.syntax() .children() - .filter_map(FnItem::cast) + .filter_map(Function::cast) } } -impl FnItem { +impl Function { pub fn name(&self) -> Option> { self.syntax() .children() diff --git a/src/grammar.ron b/src/grammar.ron index b6a870d84e..bcc79843aa 100644 --- a/src/grammar.ron +++ b/src/grammar.ron @@ -110,7 +110,7 @@ Grammar( "STRUCT_ITEM", "ENUM_ITEM", - "FN_ITEM", + "FUNCTION", "EXTERN_CRATE_ITEM", "MOD_ITEM", "USE_ITEM", @@ -218,7 +218,7 @@ Grammar( kind: "FILE" ), ( - kind: "FN_ITEM" + kind: "FUNCTION" ), ( kind: "NAME" diff --git a/src/grammar/items/mod.rs b/src/grammar/items/mod.rs index 824f1296c7..3bf906f856 100644 --- a/src/grammar/items/mod.rs +++ b/src/grammar/items/mod.rs @@ -107,8 +107,8 @@ pub(super) fn maybe_item(p: &mut Parser) -> MaybeItem { // test unsafe_fn // unsafe fn foo() {} FN_KW => { - fn_item(p); - FN_ITEM + function(p); + FUNCTION } // test unsafe_trait @@ -217,12 +217,12 @@ fn extern_block(p: &mut Parser) { p.expect(R_CURLY); } -fn fn_item(p: &mut Parser) { +fn function(p: &mut Parser) { assert!(p.at(FN_KW)); p.bump(); name(p); - // test fn_item_type_params + // test function_type_params // fn foo(){} type_params::type_param_list(p); @@ -231,12 +231,12 @@ fn fn_item(p: &mut Parser) { } else { p.error("expected function arguments"); } - // test fn_item_ret_type + // test function_ret_type // fn foo() {} // fn bar() -> () {} fn_ret_type(p); - // test fn_item_where_clause + // test function_where_clause // fn foo() where T: Copy {} type_params::where_clause(p); diff --git a/src/grammar/mod.rs b/src/grammar/mod.rs index 1e7d04ce93..e1329044d1 100644 --- a/src/grammar/mod.rs +++ b/src/grammar/mod.rs @@ -14,7 +14,7 @@ //! `// test name-of-the-test` comment and look like this: //! //! ``` -//! // test fn_item_with_zero_parameters +//! // test function_with_zero_parameters //! // fn foo() {} //! ``` //! diff --git a/src/syntax_kinds/generated.rs b/src/syntax_kinds/generated.rs index 84f90c5935..de2807ba63 100644 --- a/src/syntax_kinds/generated.rs +++ b/src/syntax_kinds/generated.rs @@ -110,7 +110,7 @@ pub enum SyntaxKind { FILE, STRUCT_ITEM, ENUM_ITEM, - FN_ITEM, + FUNCTION, EXTERN_CRATE_ITEM, MOD_ITEM, USE_ITEM, @@ -345,7 +345,7 @@ impl SyntaxKind { FILE => &SyntaxInfo { name: "FILE" }, STRUCT_ITEM => &SyntaxInfo { name: "STRUCT_ITEM" }, ENUM_ITEM => &SyntaxInfo { name: "ENUM_ITEM" }, - FN_ITEM => &SyntaxInfo { name: "FN_ITEM" }, + FUNCTION => &SyntaxInfo { name: "FUNCTION" }, EXTERN_CRATE_ITEM => &SyntaxInfo { name: "EXTERN_CRATE_ITEM" }, MOD_ITEM => &SyntaxInfo { name: "MOD_ITEM" }, USE_ITEM => &SyntaxInfo { name: "USE_ITEM" }, diff --git a/tests/data/parser/err/0005_attribute_recover.txt b/tests/data/parser/err/0005_attribute_recover.txt index 3f5f0aec98..079b0d1f6d 100644 --- a/tests/data/parser/err/0005_attribute_recover.txt +++ b/tests/data/parser/err/0005_attribute_recover.txt @@ -1,5 +1,5 @@ FILE@[0; 54) - FN_ITEM@[0; 31) + FUNCTION@[0; 31) ATTR@[0; 18) POUND@[0; 1) L_BRACK@[1; 2) @@ -35,7 +35,7 @@ FILE@[0; 54) WHITESPACE@[29; 30) R_CURLY@[30; 31) WHITESPACE@[31; 34) - FN_ITEM@[34; 53) + FUNCTION@[34; 53) ATTR@[34; 40) POUND@[34; 35) L_BRACK@[35; 36) diff --git a/tests/data/parser/err/0007_stray_curly_in_file.txt b/tests/data/parser/err/0007_stray_curly_in_file.txt index beca9be38e..b36decb464 100644 --- a/tests/data/parser/err/0007_stray_curly_in_file.txt +++ b/tests/data/parser/err/0007_stray_curly_in_file.txt @@ -14,7 +14,7 @@ FILE@[0; 31) ERROR@[14; 15) R_CURLY@[14; 15) WHITESPACE@[15; 17) - FN_ITEM@[17; 27) + FUNCTION@[17; 27) FN_KW@[17; 19) WHITESPACE@[19; 20) NAME@[20; 23) diff --git a/tests/data/parser/err/0008_item_block_recovery.txt b/tests/data/parser/err/0008_item_block_recovery.txt index eb1c8faa62..f2a503cec0 100644 --- a/tests/data/parser/err/0008_item_block_recovery.txt +++ b/tests/data/parser/err/0008_item_block_recovery.txt @@ -1,5 +1,5 @@ FILE@[0; 95) - FN_ITEM@[0; 12) + FUNCTION@[0; 12) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) @@ -51,7 +51,7 @@ FILE@[0; 95) WHITESPACE@[78; 79) R_CURLY@[79; 80) WHITESPACE@[80; 82) - FN_ITEM@[82; 94) + FUNCTION@[82; 94) FN_KW@[82; 84) WHITESPACE@[84; 85) NAME@[85; 88) diff --git a/tests/data/parser/err/0010_unsafe_lambda_block.txt b/tests/data/parser/err/0010_unsafe_lambda_block.txt index 0bc6c10b7c..95d4af4245 100644 --- a/tests/data/parser/err/0010_unsafe_lambda_block.txt +++ b/tests/data/parser/err/0010_unsafe_lambda_block.txt @@ -1,5 +1,5 @@ FILE@[0; 42) - FN_ITEM@[0; 41) + FUNCTION@[0; 41) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 7) diff --git a/tests/data/parser/err/0012_broken_lambda.txt b/tests/data/parser/err/0012_broken_lambda.txt index f484419a20..cf6e68a782 100644 --- a/tests/data/parser/err/0012_broken_lambda.txt +++ b/tests/data/parser/err/0012_broken_lambda.txt @@ -1,5 +1,5 @@ FILE@[0; 389) - FN_ITEM@[0; 389) + FUNCTION@[0; 389) VISIBILITY@[0; 10) PUB_KW@[0; 3) L_PAREN@[3; 4) diff --git a/tests/data/parser/inline/0001_const_unsafe_fn.txt b/tests/data/parser/inline/0001_const_unsafe_fn.txt index b1eb657a46..3932d033c5 100644 --- a/tests/data/parser/inline/0001_const_unsafe_fn.txt +++ b/tests/data/parser/inline/0001_const_unsafe_fn.txt @@ -1,5 +1,5 @@ FILE@[0; 25) - FN_ITEM@[0; 24) + FUNCTION@[0; 24) CONST_KW@[0; 5) WHITESPACE@[5; 6) UNSAFE_KW@[6; 12) diff --git a/tests/data/parser/inline/0002_const_fn.txt b/tests/data/parser/inline/0002_const_fn.txt index a83b1d1c78..bc72ab2356 100644 --- a/tests/data/parser/inline/0002_const_fn.txt +++ b/tests/data/parser/inline/0002_const_fn.txt @@ -1,5 +1,5 @@ FILE@[0; 18) - FN_ITEM@[0; 17) + FUNCTION@[0; 17) CONST_KW@[0; 5) WHITESPACE@[5; 6) FN_KW@[6; 8) diff --git a/tests/data/parser/inline/0004_extern_fn.txt b/tests/data/parser/inline/0004_extern_fn.txt index 247fb229d4..e7787d4aba 100644 --- a/tests/data/parser/inline/0004_extern_fn.txt +++ b/tests/data/parser/inline/0004_extern_fn.txt @@ -1,5 +1,5 @@ FILE@[0; 19) - FN_ITEM@[0; 18) + FUNCTION@[0; 18) ABI@[0; 6) EXTERN_KW@[0; 6) WHITESPACE@[6; 7) diff --git a/tests/data/parser/inline/0011_unsafe_fn.txt b/tests/data/parser/inline/0011_unsafe_fn.txt index 3af80b1f85..9e5dcafa63 100644 --- a/tests/data/parser/inline/0011_unsafe_fn.txt +++ b/tests/data/parser/inline/0011_unsafe_fn.txt @@ -1,5 +1,5 @@ FILE@[0; 19) - FN_ITEM@[0; 18) + FUNCTION@[0; 18) UNSAFE_KW@[0; 6) WHITESPACE@[6; 7) FN_KW@[7; 9) diff --git a/tests/data/parser/inline/0012_unsafe_extern_fn.txt b/tests/data/parser/inline/0012_unsafe_extern_fn.txt index af502740e9..7ed4d42c19 100644 --- a/tests/data/parser/inline/0012_unsafe_extern_fn.txt +++ b/tests/data/parser/inline/0012_unsafe_extern_fn.txt @@ -1,5 +1,5 @@ FILE@[0; 30) - FN_ITEM@[0; 29) + FUNCTION@[0; 29) UNSAFE_KW@[0; 6) WHITESPACE@[6; 7) ABI@[7; 17) diff --git a/tests/data/parser/inline/0013_unsafe_block_in_mod.txt b/tests/data/parser/inline/0013_unsafe_block_in_mod.txt index 9cf820bd27..d1bcffe779 100644 --- a/tests/data/parser/inline/0013_unsafe_block_in_mod.txt +++ b/tests/data/parser/inline/0013_unsafe_block_in_mod.txt @@ -1,5 +1,5 @@ FILE@[0; 33) - FN_ITEM@[0; 10) + FUNCTION@[0; 10) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) @@ -21,7 +21,7 @@ FILE@[0; 33) WHITESPACE@[19; 20) R_CURLY@[20; 21) WHITESPACE@[21; 22) - FN_ITEM@[22; 32) + FUNCTION@[22; 32) FN_KW@[22; 24) WHITESPACE@[24; 25) NAME@[25; 28) diff --git a/tests/data/parser/inline/0034_bind_pat.txt b/tests/data/parser/inline/0034_bind_pat.txt index 3ce7057f62..e8e4e4c2bd 100644 --- a/tests/data/parser/inline/0034_bind_pat.txt +++ b/tests/data/parser/inline/0034_bind_pat.txt @@ -1,5 +1,5 @@ FILE@[0; 146) - FN_ITEM@[0; 145) + FUNCTION@[0; 145) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 7) diff --git a/tests/data/parser/inline/0035_ref_pat.txt b/tests/data/parser/inline/0035_ref_pat.txt index 68bd89f4ec..6fbffd8b7f 100644 --- a/tests/data/parser/inline/0035_ref_pat.txt +++ b/tests/data/parser/inline/0035_ref_pat.txt @@ -1,5 +1,5 @@ FILE@[0; 52) - FN_ITEM@[0; 51) + FUNCTION@[0; 51) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 7) diff --git a/tests/data/parser/inline/0036_placeholder_pat.txt b/tests/data/parser/inline/0036_placeholder_pat.txt index fc002b112c..8c63cdfae9 100644 --- a/tests/data/parser/inline/0036_placeholder_pat.txt +++ b/tests/data/parser/inline/0036_placeholder_pat.txt @@ -1,5 +1,5 @@ FILE@[0; 26) - FN_ITEM@[0; 25) + FUNCTION@[0; 25) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 7) diff --git a/tests/data/parser/inline/0038_fn_item_ret_type.rs b/tests/data/parser/inline/0038_function_ret_type.rs similarity index 100% rename from tests/data/parser/inline/0038_fn_item_ret_type.rs rename to tests/data/parser/inline/0038_function_ret_type.rs diff --git a/tests/data/parser/inline/0038_fn_item_ret_type.txt b/tests/data/parser/inline/0038_function_ret_type.txt similarity index 94% rename from tests/data/parser/inline/0038_fn_item_ret_type.txt rename to tests/data/parser/inline/0038_function_ret_type.txt index a6157445cc..58583eefec 100644 --- a/tests/data/parser/inline/0038_fn_item_ret_type.txt +++ b/tests/data/parser/inline/0038_function_ret_type.txt @@ -1,5 +1,5 @@ FILE@[0; 30) - FN_ITEM@[0; 11) + FUNCTION@[0; 11) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) @@ -12,7 +12,7 @@ FILE@[0; 30) L_CURLY@[9; 10) R_CURLY@[10; 11) WHITESPACE@[11; 12) - FN_ITEM@[12; 29) + FUNCTION@[12; 29) FN_KW@[12; 14) WHITESPACE@[14; 15) NAME@[15; 18) diff --git a/tests/data/parser/inline/0039_path_expr.txt b/tests/data/parser/inline/0039_path_expr.txt index 90eab65f60..8b505774f9 100644 --- a/tests/data/parser/inline/0039_path_expr.txt +++ b/tests/data/parser/inline/0039_path_expr.txt @@ -1,5 +1,5 @@ FILE@[0; 91) - FN_ITEM@[0; 90) + FUNCTION@[0; 90) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0040_expr_literals.txt b/tests/data/parser/inline/0040_expr_literals.txt index bc651c2a94..192b62211b 100644 --- a/tests/data/parser/inline/0040_expr_literals.txt +++ b/tests/data/parser/inline/0040_expr_literals.txt @@ -1,5 +1,5 @@ FILE@[0; 189) - FN_ITEM@[0; 188) + FUNCTION@[0; 188) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0043_call_expr.txt b/tests/data/parser/inline/0043_call_expr.txt index 4277d5dc83..f4789d2d91 100644 --- a/tests/data/parser/inline/0043_call_expr.txt +++ b/tests/data/parser/inline/0043_call_expr.txt @@ -1,5 +1,5 @@ FILE@[0; 57) - FN_ITEM@[0; 56) + FUNCTION@[0; 56) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0044_ref_expr.txt b/tests/data/parser/inline/0044_ref_expr.txt index 29b1be9571..05f6c015a1 100644 --- a/tests/data/parser/inline/0044_ref_expr.txt +++ b/tests/data/parser/inline/0044_ref_expr.txt @@ -1,5 +1,5 @@ FILE@[0; 52) - FN_ITEM@[0; 51) + FUNCTION@[0; 51) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0045_block.txt b/tests/data/parser/inline/0045_block.txt index f68e55e1d0..8519101c32 100644 --- a/tests/data/parser/inline/0045_block.txt +++ b/tests/data/parser/inline/0045_block.txt @@ -1,5 +1,5 @@ FILE@[0; 65) - FN_ITEM@[0; 9) + FUNCTION@[0; 9) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 4) @@ -12,7 +12,7 @@ FILE@[0; 65) L_CURLY@[7; 8) R_CURLY@[8; 9) WHITESPACE@[9; 10) - FN_ITEM@[10; 31) + FUNCTION@[10; 31) FN_KW@[10; 12) WHITESPACE@[12; 13) NAME@[13; 14) @@ -38,7 +38,7 @@ FILE@[0; 65) WHITESPACE@[29; 30) R_CURLY@[30; 31) WHITESPACE@[31; 32) - FN_ITEM@[32; 48) + FUNCTION@[32; 48) FN_KW@[32; 34) WHITESPACE@[34; 35) NAME@[35; 36) @@ -62,7 +62,7 @@ FILE@[0; 65) WHITESPACE@[46; 47) R_CURLY@[47; 48) WHITESPACE@[48; 49) - FN_ITEM@[49; 64) + FUNCTION@[49; 64) FN_KW@[49; 51) WHITESPACE@[51; 52) NAME@[52; 53) diff --git a/tests/data/parser/inline/0050_let_stmt;.txt b/tests/data/parser/inline/0050_let_stmt;.txt index cac6bac3f9..44e357092d 100644 --- a/tests/data/parser/inline/0050_let_stmt;.txt +++ b/tests/data/parser/inline/0050_let_stmt;.txt @@ -1,5 +1,5 @@ FILE@[0; 77) - FN_ITEM@[0; 76) + FUNCTION@[0; 76) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0051_method_call_expr.txt b/tests/data/parser/inline/0051_method_call_expr.txt index 189c8628fd..aafb2d5f19 100644 --- a/tests/data/parser/inline/0051_method_call_expr.txt +++ b/tests/data/parser/inline/0051_method_call_expr.txt @@ -1,5 +1,5 @@ FILE@[0; 49) - FN_ITEM@[0; 48) + FUNCTION@[0; 48) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0052_field_expr.txt b/tests/data/parser/inline/0052_field_expr.txt index b3e3bcde4f..213884f90d 100644 --- a/tests/data/parser/inline/0052_field_expr.txt +++ b/tests/data/parser/inline/0052_field_expr.txt @@ -1,5 +1,5 @@ FILE@[0; 37) - FN_ITEM@[0; 36) + FUNCTION@[0; 36) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0053_block_items.txt b/tests/data/parser/inline/0053_block_items.txt index 3ba2e386c4..c5498532bd 100644 --- a/tests/data/parser/inline/0053_block_items.txt +++ b/tests/data/parser/inline/0053_block_items.txt @@ -1,5 +1,5 @@ FILE@[0; 21) - FN_ITEM@[0; 20) + FUNCTION@[0; 20) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 4) @@ -11,7 +11,7 @@ FILE@[0; 21) BLOCK_EXPR@[7; 20) L_CURLY@[7; 8) WHITESPACE@[8; 9) - FN_ITEM@[9; 18) + FUNCTION@[9; 18) FN_KW@[9; 11) WHITESPACE@[11; 12) NAME@[12; 13) diff --git a/tests/data/parser/inline/0054_impl_item_items.txt b/tests/data/parser/inline/0054_impl_item_items.txt index 89a3ae87fc..739ecbbcd8 100644 --- a/tests/data/parser/inline/0054_impl_item_items.txt +++ b/tests/data/parser/inline/0054_impl_item_items.txt @@ -44,7 +44,7 @@ FILE@[0; 89) INT_NUMBER@[46; 48) "92" SEMI@[48; 49) WHITESPACE@[49; 54) - FN_ITEM@[54; 65) + FUNCTION@[54; 65) FN_KW@[54; 56) WHITESPACE@[56; 57) NAME@[57; 60) @@ -57,7 +57,7 @@ FILE@[0; 89) L_CURLY@[63; 64) R_CURLY@[64; 65) WHITESPACE@[65; 70) - FN_ITEM@[70; 86) + FUNCTION@[70; 86) FN_KW@[70; 72) WHITESPACE@[72; 73) NAME@[73; 76) diff --git a/tests/data/parser/inline/0055_self_param.txt b/tests/data/parser/inline/0055_self_param.txt index 5c62b75ccf..1275fb8b1f 100644 --- a/tests/data/parser/inline/0055_self_param.txt +++ b/tests/data/parser/inline/0055_self_param.txt @@ -10,7 +10,7 @@ FILE@[0; 106) WHITESPACE@[6; 7) L_CURLY@[7; 8) WHITESPACE@[8; 13) - FN_ITEM@[13; 26) + FUNCTION@[13; 26) FN_KW@[13; 15) WHITESPACE@[15; 16) NAME@[16; 17) @@ -25,7 +25,7 @@ FILE@[0; 106) L_CURLY@[24; 25) R_CURLY@[25; 26) WHITESPACE@[26; 31) - FN_ITEM@[31; 46) + FUNCTION@[31; 46) FN_KW@[31; 33) WHITESPACE@[33; 34) NAME@[34; 35) @@ -42,7 +42,7 @@ FILE@[0; 106) L_CURLY@[44; 45) R_CURLY@[45; 46) WHITESPACE@[46; 51) - FN_ITEM@[51; 69) + FUNCTION@[51; 69) FN_KW@[51; 53) WHITESPACE@[53; 54) NAME@[54; 55) @@ -61,7 +61,7 @@ FILE@[0; 106) L_CURLY@[67; 68) R_CURLY@[68; 69) WHITESPACE@[69; 74) - FN_ITEM@[74; 103) + FUNCTION@[74; 103) FN_KW@[74; 76) WHITESPACE@[76; 77) NAME@[77; 78) diff --git a/tests/data/parser/inline/0059_fn_item_where_clause.rs b/tests/data/parser/inline/0059_function_where_clause.rs similarity index 100% rename from tests/data/parser/inline/0059_fn_item_where_clause.rs rename to tests/data/parser/inline/0059_function_where_clause.rs diff --git a/tests/data/parser/inline/0059_fn_item_where_clause.txt b/tests/data/parser/inline/0059_function_where_clause.txt similarity index 97% rename from tests/data/parser/inline/0059_fn_item_where_clause.txt rename to tests/data/parser/inline/0059_function_where_clause.txt index afedf983e4..065b0fd216 100644 --- a/tests/data/parser/inline/0059_fn_item_where_clause.txt +++ b/tests/data/parser/inline/0059_function_where_clause.txt @@ -1,5 +1,5 @@ FILE@[0; 29) - FN_ITEM@[0; 28) + FUNCTION@[0; 28) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0060_fn_item_type_params.rs b/tests/data/parser/inline/0060_function_type_params.rs similarity index 100% rename from tests/data/parser/inline/0060_fn_item_type_params.rs rename to tests/data/parser/inline/0060_function_type_params.rs diff --git a/tests/data/parser/inline/0060_fn_item_type_params.txt b/tests/data/parser/inline/0060_function_type_params.txt similarity index 97% rename from tests/data/parser/inline/0060_fn_item_type_params.txt rename to tests/data/parser/inline/0060_function_type_params.txt index 492bafdf00..8809ebc04d 100644 --- a/tests/data/parser/inline/0060_fn_item_type_params.txt +++ b/tests/data/parser/inline/0060_function_type_params.txt @@ -1,5 +1,5 @@ FILE@[0; 28) - FN_ITEM@[0; 27) + FUNCTION@[0; 27) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0061_struct_lit.txt b/tests/data/parser/inline/0061_struct_lit.txt index f602f18f0d..1d048c5bae 100644 --- a/tests/data/parser/inline/0061_struct_lit.txt +++ b/tests/data/parser/inline/0061_struct_lit.txt @@ -1,5 +1,5 @@ FILE@[0; 86) - FN_ITEM@[0; 85) + FUNCTION@[0; 85) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0063_lambda_expr.txt b/tests/data/parser/inline/0063_lambda_expr.txt index 9d2c0f8fc9..122a99e52c 100644 --- a/tests/data/parser/inline/0063_lambda_expr.txt +++ b/tests/data/parser/inline/0063_lambda_expr.txt @@ -1,5 +1,5 @@ FILE@[0; 74) - FN_ITEM@[0; 74) + FUNCTION@[0; 74) FN_KW@[0; 2) NAME@[2; 6) WHITESPACE@[2; 3) diff --git a/tests/data/parser/inline/0064_param_list.txt b/tests/data/parser/inline/0064_param_list.txt index f172851f0d..14db495b97 100644 --- a/tests/data/parser/inline/0064_param_list.txt +++ b/tests/data/parser/inline/0064_param_list.txt @@ -1,5 +1,5 @@ FILE@[0; 67) - FN_ITEM@[0; 9) + FUNCTION@[0; 9) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 4) @@ -12,7 +12,7 @@ FILE@[0; 67) L_CURLY@[7; 8) R_CURLY@[8; 9) WHITESPACE@[9; 10) - FN_ITEM@[10; 25) + FUNCTION@[10; 25) FN_KW@[10; 12) WHITESPACE@[12; 13) NAME@[13; 14) @@ -36,7 +36,7 @@ FILE@[0; 67) L_CURLY@[23; 24) R_CURLY@[24; 25) WHITESPACE@[25; 26) - FN_ITEM@[26; 43) + FUNCTION@[26; 43) FN_KW@[26; 28) WHITESPACE@[28; 29) NAME@[29; 30) @@ -62,7 +62,7 @@ FILE@[0; 67) L_CURLY@[41; 42) R_CURLY@[42; 43) WHITESPACE@[43; 44) - FN_ITEM@[44; 66) + FUNCTION@[44; 66) FN_KW@[44; 46) WHITESPACE@[46; 47) NAME@[47; 48) diff --git a/tests/data/parser/inline/0065_if_expr.txt b/tests/data/parser/inline/0065_if_expr.txt index ab32d69900..6ed53264a0 100644 --- a/tests/data/parser/inline/0065_if_expr.txt +++ b/tests/data/parser/inline/0065_if_expr.txt @@ -1,5 +1,5 @@ FILE@[0; 107) - FN_ITEM@[0; 106) + FUNCTION@[0; 106) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0066_lambda_expr.txt b/tests/data/parser/inline/0066_lambda_expr.txt index 388c61ad5a..6d9aeb3319 100644 --- a/tests/data/parser/inline/0066_lambda_expr.txt +++ b/tests/data/parser/inline/0066_lambda_expr.txt @@ -1,5 +1,5 @@ FILE@[0; 79) - FN_ITEM@[0; 78) + FUNCTION@[0; 78) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0067_block_expr.txt b/tests/data/parser/inline/0067_block_expr.txt index 41f7143124..981f39e6ee 100644 --- a/tests/data/parser/inline/0067_block_expr.txt +++ b/tests/data/parser/inline/0067_block_expr.txt @@ -1,5 +1,5 @@ FILE@[0; 36) - FN_ITEM@[0; 35) + FUNCTION@[0; 35) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0068_pub_expr.txt b/tests/data/parser/inline/0068_pub_expr.txt index ee691f25e1..92e58938b1 100644 --- a/tests/data/parser/inline/0068_pub_expr.txt +++ b/tests/data/parser/inline/0068_pub_expr.txt @@ -1,5 +1,5 @@ FILE@[0; 29) - FN_ITEM@[0; 20) + FUNCTION@[0; 20) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0068_return_expr.txt b/tests/data/parser/inline/0068_return_expr.txt index 683a3dc8f1..4e4ec85b6f 100644 --- a/tests/data/parser/inline/0068_return_expr.txt +++ b/tests/data/parser/inline/0068_return_expr.txt @@ -1,5 +1,5 @@ FILE@[0; 40) - FN_ITEM@[0; 39) + FUNCTION@[0; 39) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0069_match_arm.txt b/tests/data/parser/inline/0069_match_arm.txt index 3446dfa436..3377e83425 100644 --- a/tests/data/parser/inline/0069_match_arm.txt +++ b/tests/data/parser/inline/0069_match_arm.txt @@ -1,5 +1,5 @@ FILE@[0; 78) - FN_ITEM@[0; 77) + FUNCTION@[0; 77) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0070_match_expr.txt b/tests/data/parser/inline/0070_match_expr.txt index e003f08782..f9ba544866 100644 --- a/tests/data/parser/inline/0070_match_expr.txt +++ b/tests/data/parser/inline/0070_match_expr.txt @@ -1,5 +1,5 @@ FILE@[0; 47) - FN_ITEM@[0; 46) + FUNCTION@[0; 46) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0071_tuple_pat_fields.txt b/tests/data/parser/inline/0071_tuple_pat_fields.txt index 1eca6d3701..f548352779 100644 --- a/tests/data/parser/inline/0071_tuple_pat_fields.txt +++ b/tests/data/parser/inline/0071_tuple_pat_fields.txt @@ -1,5 +1,5 @@ FILE@[0; 97) - FN_ITEM@[0; 96) + FUNCTION@[0; 96) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0072_path_part.txt b/tests/data/parser/inline/0072_path_part.txt index 0c7865998a..20da5de86c 100644 --- a/tests/data/parser/inline/0072_path_part.txt +++ b/tests/data/parser/inline/0072_path_part.txt @@ -1,5 +1,5 @@ FILE@[0; 103) - FN_ITEM@[0; 102) + FUNCTION@[0; 102) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0073_struct_pat_fields.txt b/tests/data/parser/inline/0073_struct_pat_fields.txt index 8482edd3ca..fc0d44f7af 100644 --- a/tests/data/parser/inline/0073_struct_pat_fields.txt +++ b/tests/data/parser/inline/0073_struct_pat_fields.txt @@ -1,5 +1,5 @@ FILE@[0; 119) - FN_ITEM@[0; 118) + FUNCTION@[0; 118) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0074_unary_expr.txt b/tests/data/parser/inline/0074_unary_expr.txt index 072b805ad0..e0b4ff964c 100644 --- a/tests/data/parser/inline/0074_unary_expr.txt +++ b/tests/data/parser/inline/0074_unary_expr.txt @@ -1,5 +1,5 @@ FILE@[0; 44) - FN_ITEM@[0; 43) + FUNCTION@[0; 43) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0075_try_expr.txt b/tests/data/parser/inline/0075_try_expr.txt index 2cfd0e3684..f7b86f269f 100644 --- a/tests/data/parser/inline/0075_try_expr.txt +++ b/tests/data/parser/inline/0075_try_expr.txt @@ -1,5 +1,5 @@ FILE@[0; 21) - FN_ITEM@[0; 20) + FUNCTION@[0; 20) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0076_cond.txt b/tests/data/parser/inline/0076_cond.txt index e8cf677cff..0cde88a90b 100644 --- a/tests/data/parser/inline/0076_cond.txt +++ b/tests/data/parser/inline/0076_cond.txt @@ -1,5 +1,5 @@ FILE@[0; 38) - FN_ITEM@[0; 37) + FUNCTION@[0; 37) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0077_while_expr.txt b/tests/data/parser/inline/0077_while_expr.txt index 5c936a607f..82e63fd46b 100644 --- a/tests/data/parser/inline/0077_while_expr.txt +++ b/tests/data/parser/inline/0077_while_expr.txt @@ -1,5 +1,5 @@ FILE@[0; 70) - FN_ITEM@[0; 69) + FUNCTION@[0; 69) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0078_mod_contents.txt b/tests/data/parser/inline/0078_mod_contents.txt index 482e36534d..c003d24e1b 100644 --- a/tests/data/parser/inline/0078_mod_contents.txt +++ b/tests/data/parser/inline/0078_mod_contents.txt @@ -1,5 +1,5 @@ FILE@[0; 70) - FN_ITEM@[0; 11) + FUNCTION@[0; 11) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0079_cast_expr.txt b/tests/data/parser/inline/0079_cast_expr.txt index 78210f0d58..642557e15f 100644 --- a/tests/data/parser/inline/0079_cast_expr.txt +++ b/tests/data/parser/inline/0079_cast_expr.txt @@ -1,5 +1,5 @@ FILE@[0; 28) - FN_ITEM@[0; 27) + FUNCTION@[0; 27) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0080_tuple_expr.txt b/tests/data/parser/inline/0080_tuple_expr.txt index 949faf30cc..728ba6ec76 100644 --- a/tests/data/parser/inline/0080_tuple_expr.txt +++ b/tests/data/parser/inline/0080_tuple_expr.txt @@ -1,5 +1,5 @@ FILE@[0; 40) - FN_ITEM@[0; 39) + FUNCTION@[0; 39) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0081_index_expr.txt b/tests/data/parser/inline/0081_index_expr.txt index cde5735a27..80af4caed1 100644 --- a/tests/data/parser/inline/0081_index_expr.txt +++ b/tests/data/parser/inline/0081_index_expr.txt @@ -1,5 +1,5 @@ FILE@[0; 26) - FN_ITEM@[0; 25) + FUNCTION@[0; 25) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0082_tuple_pat.txt b/tests/data/parser/inline/0082_tuple_pat.txt index 6c2f25d366..d8314b5d84 100644 --- a/tests/data/parser/inline/0082_tuple_pat.txt +++ b/tests/data/parser/inline/0082_tuple_pat.txt @@ -1,5 +1,5 @@ FILE@[0; 39) - FN_ITEM@[0; 38) + FUNCTION@[0; 38) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 7) diff --git a/tests/data/parser/inline/0083_postfix_range.txt b/tests/data/parser/inline/0083_postfix_range.txt index ff2ed056e9..bf9b2c695e 100644 --- a/tests/data/parser/inline/0083_postfix_range.txt +++ b/tests/data/parser/inline/0083_postfix_range.txt @@ -1,5 +1,5 @@ FILE@[0; 26) - FN_ITEM@[0; 25) + FUNCTION@[0; 25) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0084_loop_expr.txt b/tests/data/parser/inline/0084_loop_expr.txt index 967c283c54..5e0de55d49 100644 --- a/tests/data/parser/inline/0084_loop_expr.txt +++ b/tests/data/parser/inline/0084_loop_expr.txt @@ -1,5 +1,5 @@ FILE@[0; 26) - FN_ITEM@[0; 25) + FUNCTION@[0; 25) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0085_for_expr.txt b/tests/data/parser/inline/0085_for_expr.txt index f96139314c..3a378cfcf9 100644 --- a/tests/data/parser/inline/0085_for_expr.txt +++ b/tests/data/parser/inline/0085_for_expr.txt @@ -1,5 +1,5 @@ FILE@[0; 33) - FN_ITEM@[0; 32) + FUNCTION@[0; 32) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0085_match_arms_commas.txt b/tests/data/parser/inline/0085_match_arms_commas.txt index 6dfc6c9dd4..5465a37979 100644 --- a/tests/data/parser/inline/0085_match_arms_commas.txt +++ b/tests/data/parser/inline/0085_match_arms_commas.txt @@ -1,5 +1,5 @@ FILE@[0; 83) - FN_ITEM@[0; 82) + FUNCTION@[0; 82) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0086_array_expr.txt b/tests/data/parser/inline/0086_array_expr.txt index f72b116170..9a5f56edf0 100644 --- a/tests/data/parser/inline/0086_array_expr.txt +++ b/tests/data/parser/inline/0086_array_expr.txt @@ -1,5 +1,5 @@ FILE@[0; 55) - FN_ITEM@[0; 54) + FUNCTION@[0; 54) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0086_no_semi_after_block.txt b/tests/data/parser/inline/0086_no_semi_after_block.txt index dd05a8a9f7..d19a270ace 100644 --- a/tests/data/parser/inline/0086_no_semi_after_block.txt +++ b/tests/data/parser/inline/0086_no_semi_after_block.txt @@ -1,5 +1,5 @@ FILE@[0; 107) - FN_ITEM@[0; 106) + FUNCTION@[0; 106) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0087_stmt_postfix_expr_ambiguity.txt b/tests/data/parser/inline/0087_stmt_postfix_expr_ambiguity.txt index 47b4d44810..e83b6d183e 100644 --- a/tests/data/parser/inline/0087_stmt_postfix_expr_ambiguity.txt +++ b/tests/data/parser/inline/0087_stmt_postfix_expr_ambiguity.txt @@ -1,5 +1,5 @@ FILE@[0; 84) - FN_ITEM@[0; 83) + FUNCTION@[0; 83) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0088_stmt_bin_expr_ambiguity.txt b/tests/data/parser/inline/0088_stmt_bin_expr_ambiguity.txt index df0aa44b38..df4c20b0ec 100644 --- a/tests/data/parser/inline/0088_stmt_bin_expr_ambiguity.txt +++ b/tests/data/parser/inline/0088_stmt_bin_expr_ambiguity.txt @@ -1,5 +1,5 @@ FILE@[0; 46) - FN_ITEM@[0; 45) + FUNCTION@[0; 45) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0089_slice_pat.txt b/tests/data/parser/inline/0089_slice_pat.txt index 1e7f201199..8379df33bf 100644 --- a/tests/data/parser/inline/0089_slice_pat.txt +++ b/tests/data/parser/inline/0089_slice_pat.txt @@ -1,5 +1,5 @@ FILE@[0; 39) - FN_ITEM@[0; 38) + FUNCTION@[0; 38) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 7) diff --git a/tests/data/parser/inline/0090_trait_item_items.txt b/tests/data/parser/inline/0090_trait_item_items.txt index 2350bbe826..c04c48588e 100644 --- a/tests/data/parser/inline/0090_trait_item_items.txt +++ b/tests/data/parser/inline/0090_trait_item_items.txt @@ -37,7 +37,7 @@ FILE@[0; 83) IDENT@[41; 44) "i32" SEMI@[44; 45) WHITESPACE@[45; 50) - FN_ITEM@[50; 61) + FUNCTION@[50; 61) FN_KW@[50; 52) WHITESPACE@[52; 53) NAME@[53; 56) @@ -50,7 +50,7 @@ FILE@[0; 83) L_CURLY@[59; 60) R_CURLY@[60; 61) WHITESPACE@[61; 66) - FN_ITEM@[66; 80) + FUNCTION@[66; 80) FN_KW@[66; 68) WHITESPACE@[68; 69) NAME@[69; 72) diff --git a/tests/data/parser/inline/0091_fn_decl.txt b/tests/data/parser/inline/0091_fn_decl.txt index e5e5bfc085..5a76af6525 100644 --- a/tests/data/parser/inline/0091_fn_decl.txt +++ b/tests/data/parser/inline/0091_fn_decl.txt @@ -7,7 +7,7 @@ FILE@[0; 22) WHITESPACE@[7; 8) L_CURLY@[8; 9) WHITESPACE@[9; 10) - FN_ITEM@[10; 19) + FUNCTION@[10; 19) FN_KW@[10; 12) WHITESPACE@[12; 13) NAME@[13; 16) diff --git a/tests/data/parser/inline/0092_literal_pattern.txt b/tests/data/parser/inline/0092_literal_pattern.txt index 08ade31fb6..a2f9854089 100644 --- a/tests/data/parser/inline/0092_literal_pattern.txt +++ b/tests/data/parser/inline/0092_literal_pattern.txt @@ -1,5 +1,5 @@ FILE@[0; 95) - FN_ITEM@[0; 94) + FUNCTION@[0; 94) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 7) diff --git a/tests/data/parser/inline/0094_range_pat.txt b/tests/data/parser/inline/0094_range_pat.txt index 01aed336be..cb858044a8 100644 --- a/tests/data/parser/inline/0094_range_pat.txt +++ b/tests/data/parser/inline/0094_range_pat.txt @@ -1,5 +1,5 @@ FILE@[0; 47) - FN_ITEM@[0; 46) + FUNCTION@[0; 46) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 7) diff --git a/tests/data/parser/inline/0095_path_type_with_bounds.txt b/tests/data/parser/inline/0095_path_type_with_bounds.txt index aeda229d5c..57c38e7ee3 100644 --- a/tests/data/parser/inline/0095_path_type_with_bounds.txt +++ b/tests/data/parser/inline/0095_path_type_with_bounds.txt @@ -1,5 +1,5 @@ FILE@[0; 27) - FN_ITEM@[0; 26) + FUNCTION@[0; 26) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0097_param_list_opt_patterns.txt b/tests/data/parser/inline/0097_param_list_opt_patterns.txt index f8a37aebbe..4cb3bdac54 100644 --- a/tests/data/parser/inline/0097_param_list_opt_patterns.txt +++ b/tests/data/parser/inline/0097_param_list_opt_patterns.txt @@ -1,5 +1,5 @@ FILE@[0; 35) - FN_ITEM@[0; 34) + FUNCTION@[0; 34) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0098_where_clause.txt b/tests/data/parser/inline/0098_where_clause.txt index a1180b554a..150f125a77 100644 --- a/tests/data/parser/inline/0098_where_clause.txt +++ b/tests/data/parser/inline/0098_where_clause.txt @@ -1,5 +1,5 @@ FILE@[0; 87) - FN_ITEM@[0; 86) + FUNCTION@[0; 86) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/inline/0099_crate_keyword_vis.txt b/tests/data/parser/inline/0099_crate_keyword_vis.txt index 25e6d17593..a830d99d95 100644 --- a/tests/data/parser/inline/0099_crate_keyword_vis.txt +++ b/tests/data/parser/inline/0099_crate_keyword_vis.txt @@ -1,5 +1,5 @@ FILE@[0; 20) - FN_ITEM@[0; 19) + FUNCTION@[0; 19) VISIBILITY@[0; 5) CRATE_KW@[0; 5) WHITESPACE@[5; 6) diff --git a/tests/data/parser/ok/0005_fn_item.txt b/tests/data/parser/ok/0005_fn_item.txt index 78ed3dffe3..4ab93d408f 100644 --- a/tests/data/parser/ok/0005_fn_item.txt +++ b/tests/data/parser/ok/0005_fn_item.txt @@ -1,5 +1,5 @@ FILE@[0; 13) - FN_ITEM@[0; 12) + FUNCTION@[0; 12) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6) diff --git a/tests/data/parser/ok/0008_mod_item.txt b/tests/data/parser/ok/0008_mod_item.txt index 4af763ec9a..1dcaaedce5 100644 --- a/tests/data/parser/ok/0008_mod_item.txt +++ b/tests/data/parser/ok/0008_mod_item.txt @@ -24,7 +24,7 @@ FILE@[0; 118) WHITESPACE@[24; 25) L_CURLY@[25; 26) WHITESPACE@[26; 31) - FN_ITEM@[31; 47) + FUNCTION@[31; 47) FN_KW@[31; 33) WHITESPACE@[33; 34) NAME@[34; 37) diff --git a/tests/data/parser/ok/0011_outer_attribute.txt b/tests/data/parser/ok/0011_outer_attribute.txt index f5c21ee108..9824c90834 100644 --- a/tests/data/parser/ok/0011_outer_attribute.txt +++ b/tests/data/parser/ok/0011_outer_attribute.txt @@ -1,5 +1,5 @@ FILE@[0; 35) - FN_ITEM@[0; 34) + FUNCTION@[0; 34) ATTR@[0; 12) POUND@[0; 1) L_BRACK@[1; 2) diff --git a/tests/data/parser/ok/0012_visibility.txt b/tests/data/parser/ok/0012_visibility.txt index 01edc871a6..af0c59543c 100644 --- a/tests/data/parser/ok/0012_visibility.txt +++ b/tests/data/parser/ok/0012_visibility.txt @@ -1,5 +1,5 @@ FILE@[0; 98) - FN_ITEM@[0; 9) + FUNCTION@[0; 9) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 4) @@ -12,7 +12,7 @@ FILE@[0; 98) L_CURLY@[7; 8) R_CURLY@[8; 9) WHITESPACE@[9; 10) - FN_ITEM@[10; 23) + FUNCTION@[10; 23) VISIBILITY@[10; 13) PUB_KW@[10; 13) WHITESPACE@[13; 14) @@ -28,7 +28,7 @@ FILE@[0; 98) L_CURLY@[21; 22) R_CURLY@[22; 23) WHITESPACE@[23; 24) - FN_ITEM@[24; 44) + FUNCTION@[24; 44) VISIBILITY@[24; 34) PUB_KW@[24; 27) L_PAREN@[27; 28) @@ -47,7 +47,7 @@ FILE@[0; 98) L_CURLY@[42; 43) R_CURLY@[43; 44) WHITESPACE@[44; 45) - FN_ITEM@[45; 65) + FUNCTION@[45; 65) VISIBILITY@[45; 55) PUB_KW@[45; 48) L_PAREN@[48; 49) @@ -66,7 +66,7 @@ FILE@[0; 98) L_CURLY@[63; 64) R_CURLY@[64; 65) WHITESPACE@[65; 66) - FN_ITEM@[66; 97) + FUNCTION@[66; 97) VISIBILITY@[66; 87) PUB_KW@[66; 69) L_PAREN@[69; 70) diff --git a/tests/data/parser/ok/0017_attr_trailing_comma.txt b/tests/data/parser/ok/0017_attr_trailing_comma.txt index c0e6872742..69724cdc88 100644 --- a/tests/data/parser/ok/0017_attr_trailing_comma.txt +++ b/tests/data/parser/ok/0017_attr_trailing_comma.txt @@ -1,5 +1,5 @@ FILE@[0; 23) - FN_ITEM@[0; 22) + FUNCTION@[0; 22) ATTR@[0; 10) POUND@[0; 1) L_BRACK@[1; 2) diff --git a/tests/data/parser/ok/0021_extern_fn.txt b/tests/data/parser/ok/0021_extern_fn.txt index 241e458aee..07d5cc157a 100644 --- a/tests/data/parser/ok/0021_extern_fn.txt +++ b/tests/data/parser/ok/0021_extern_fn.txt @@ -1,5 +1,5 @@ FILE@[0; 71) - FN_ITEM@[0; 19) + FUNCTION@[0; 19) ABI@[0; 6) EXTERN_KW@[0; 6) WHITESPACE@[6; 7) @@ -16,7 +16,7 @@ FILE@[0; 71) WHITESPACE@[17; 18) R_CURLY@[18; 19) WHITESPACE@[19; 21) - FN_ITEM@[21; 44) + FUNCTION@[21; 44) ABI@[21; 31) EXTERN_KW@[21; 27) WHITESPACE@[27; 28) @@ -35,7 +35,7 @@ FILE@[0; 71) WHITESPACE@[42; 43) R_CURLY@[43; 44) WHITESPACE@[44; 46) - FN_ITEM@[46; 70) + FUNCTION@[46; 70) ABI@[46; 57) EXTERN_KW@[46; 52) WHITESPACE@[52; 53) diff --git a/tests/data/parser/ok/0025_extern_fn_in_block.txt b/tests/data/parser/ok/0025_extern_fn_in_block.txt index 4e69a410c9..46fb177b27 100644 --- a/tests/data/parser/ok/0025_extern_fn_in_block.txt +++ b/tests/data/parser/ok/0025_extern_fn_in_block.txt @@ -1,5 +1,5 @@ FILE@[0; 35) - FN_ITEM@[0; 34) + FUNCTION@[0; 34) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 7) @@ -11,7 +11,7 @@ FILE@[0; 35) BLOCK_EXPR@[10; 34) L_CURLY@[10; 11) WHITESPACE@[11; 16) - FN_ITEM@[16; 32) + FUNCTION@[16; 32) ABI@[16; 22) EXTERN_KW@[16; 22) WHITESPACE@[22; 23) diff --git a/tests/data/parser/ok/0026_const_fn_in_block.txt b/tests/data/parser/ok/0026_const_fn_in_block.txt index c474f884f3..a450762a88 100644 --- a/tests/data/parser/ok/0026_const_fn_in_block.txt +++ b/tests/data/parser/ok/0026_const_fn_in_block.txt @@ -1,5 +1,5 @@ FILE@[0; 34) - FN_ITEM@[0; 33) + FUNCTION@[0; 33) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 7) @@ -11,7 +11,7 @@ FILE@[0; 34) BLOCK_EXPR@[10; 33) L_CURLY@[10; 11) WHITESPACE@[11; 16) - FN_ITEM@[16; 31) + FUNCTION@[16; 31) CONST_KW@[16; 21) WHITESPACE@[21; 22) FN_KW@[22; 24) diff --git a/tests/data/parser/ok/0027_unsafe_fn_in_block.txt b/tests/data/parser/ok/0027_unsafe_fn_in_block.txt index 8e6124b0d9..28cd7ad3d0 100644 --- a/tests/data/parser/ok/0027_unsafe_fn_in_block.txt +++ b/tests/data/parser/ok/0027_unsafe_fn_in_block.txt @@ -1,5 +1,5 @@ FILE@[0; 53) - FN_ITEM@[0; 52) + FUNCTION@[0; 52) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 7) @@ -11,7 +11,7 @@ FILE@[0; 53) BLOCK_EXPR@[10; 52) L_CURLY@[10; 11) WHITESPACE@[11; 16) - FN_ITEM@[16; 32) + FUNCTION@[16; 32) UNSAFE_KW@[16; 22) WHITESPACE@[22; 23) FN_KW@[23; 25) diff --git a/tests/data/parser/ok/0028_operator_binding_power.txt b/tests/data/parser/ok/0028_operator_binding_power.txt index 2cabd289e4..3fb1ae8112 100644 --- a/tests/data/parser/ok/0028_operator_binding_power.txt +++ b/tests/data/parser/ok/0028_operator_binding_power.txt @@ -1,5 +1,5 @@ FILE@[0; 248) - FN_ITEM@[0; 247) + FUNCTION@[0; 247) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 16) diff --git a/tests/data/parser/ok/0029_range_forms.txt b/tests/data/parser/ok/0029_range_forms.txt index 2dbc6bdeec..91d5e5bbac 100644 --- a/tests/data/parser/ok/0029_range_forms.txt +++ b/tests/data/parser/ok/0029_range_forms.txt @@ -1,5 +1,5 @@ FILE@[0; 79) - FN_ITEM@[0; 78) + FUNCTION@[0; 78) FN_KW@[0; 2) WHITESPACE@[2; 3) NAME@[3; 6)