aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/expr.rs
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2019-01-12 20:58:16 +0000
committerFlorian Diebold <[email protected]>2019-01-12 20:58:16 +0000
commit1ed7fbfc1badd2c2a42b4dc2feb1b4bf7835d3ef (patch)
tree8e0a5cd3e1981bf0ff9615636d45566dd85fdb97 /crates/ra_hir/src/expr.rs
parent5db5f5cc1dc5dfbded866b59570afc50538b9091 (diff)
args -> params
Diffstat (limited to 'crates/ra_hir/src/expr.rs')
-rw-r--r--crates/ra_hir/src/expr.rs26
1 files changed, 13 insertions, 13 deletions
diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs
index e5596cbaa..67e123e4d 100644
--- a/crates/ra_hir/src/expr.rs
+++ b/crates/ra_hir/src/expr.rs
@@ -18,13 +18,13 @@ impl_arena_id!(ExprId);
18pub struct Body { 18pub struct Body {
19 exprs: Arena<ExprId, Expr>, 19 exprs: Arena<ExprId, Expr>,
20 pats: Arena<PatId, Pat>, 20 pats: Arena<PatId, Pat>,
21 /// The patterns for the function's arguments. While the argument types are 21 /// The patterns for the function's parameters. While the parameter types are
22 /// part of the function signature, the patterns are not (they don't change 22 /// part of the function signature, the patterns are not (they don't change
23 /// the external type of the function). 23 /// the external type of the function).
24 /// 24 ///
25 /// If this `Body` is for the body of a constant, this will just be 25 /// If this `Body` is for the body of a constant, this will just be
26 /// empty. 26 /// empty.
27 args: Vec<PatId>, 27 params: Vec<PatId>,
28 /// The `ExprId` of the actual body expression. 28 /// The `ExprId` of the actual body expression.
29 body_expr: ExprId, 29 body_expr: ExprId,
30} 30}
@@ -44,8 +44,8 @@ pub struct BodySyntaxMapping {
44} 44}
45 45
46impl Body { 46impl Body {
47 pub fn args(&self) -> &[PatId] { 47 pub fn params(&self) -> &[PatId] {
48 &self.args 48 &self.params
49 } 49 }
50 50
51 pub fn body_expr(&self) -> ExprId { 51 pub fn body_expr(&self) -> ExprId {
@@ -699,11 +699,11 @@ impl ExprCollector {
699 } 699 }
700 } 700 }
701 701
702 fn into_body_syntax_mapping(self, args: Vec<PatId>, body_expr: ExprId) -> BodySyntaxMapping { 702 fn into_body_syntax_mapping(self, params: Vec<PatId>, body_expr: ExprId) -> BodySyntaxMapping {
703 let body = Body { 703 let body = Body {
704 exprs: self.exprs, 704 exprs: self.exprs,
705 pats: self.pats, 705 pats: self.pats,
706 args, 706 params,
707 body_expr, 707 body_expr,
708 }; 708 };
709 BodySyntaxMapping { 709 BodySyntaxMapping {
@@ -719,8 +719,8 @@ impl ExprCollector {
719pub(crate) fn collect_fn_body_syntax(node: &ast::FnDef) -> BodySyntaxMapping { 719pub(crate) fn collect_fn_body_syntax(node: &ast::FnDef) -> BodySyntaxMapping {
720 let mut collector = ExprCollector::new(); 720 let mut collector = ExprCollector::new();
721 721
722 let args = if let Some(param_list) = node.param_list() { 722 let params = if let Some(param_list) = node.param_list() {
723 let mut args = Vec::new(); 723 let mut params = Vec::new();
724 724
725 if let Some(self_param) = param_list.self_param() { 725 if let Some(self_param) = param_list.self_param() {
726 let self_param = LocalSyntaxPtr::new( 726 let self_param = LocalSyntaxPtr::new(
@@ -729,13 +729,13 @@ pub(crate) fn collect_fn_body_syntax(node: &ast::FnDef) -> BodySyntaxMapping {
729 .expect("self param without self keyword") 729 .expect("self param without self keyword")
730 .syntax(), 730 .syntax(),
731 ); 731 );
732 let arg = collector.alloc_pat( 732 let param = collector.alloc_pat(
733 Pat::Bind { 733 Pat::Bind {
734 name: Name::self_param(), 734 name: Name::self_param(),
735 }, 735 },
736 self_param, 736 self_param,
737 ); 737 );
738 args.push(arg); 738 params.push(param);
739 } 739 }
740 740
741 for param in param_list.params() { 741 for param in param_list.params() {
@@ -744,15 +744,15 @@ pub(crate) fn collect_fn_body_syntax(node: &ast::FnDef) -> BodySyntaxMapping {
744 } else { 744 } else {
745 continue; 745 continue;
746 }; 746 };
747 args.push(collector.collect_pat(pat)); 747 params.push(collector.collect_pat(pat));
748 } 748 }
749 args 749 params
750 } else { 750 } else {
751 Vec::new() 751 Vec::new()
752 }; 752 };
753 753
754 let body = collector.collect_block_opt(node.body()); 754 let body = collector.collect_block_opt(node.body());
755 collector.into_body_syntax_mapping(args, body) 755 collector.into_body_syntax_mapping(params, body)
756} 756}
757 757
758pub(crate) fn body_syntax_mapping( 758pub(crate) fn body_syntax_mapping(