diff --git a/src/compiler/cst/parser.rs b/src/compiler/cst/parser.rs index b166d86..26b4a7c 100644 --- a/src/compiler/cst/parser.rs +++ b/src/compiler/cst/parser.rs @@ -231,10 +231,9 @@ fn parse_atom_function_into(node: &AstNode, buf: &mut Vec) -> Result<() fn parse_atom_fn_params(node: &AstNode) -> Result, CstParserError> { guard_node_type(node, AstNodeType::AtomFnParams)?; - let mut param_counter = 0; let mut buf = Vec::new(); - for child in &node.children { + for (param_counter, child) in node.children.iter().enumerate() { guard_node_type(child, AstNodeType::AtomFnParam)?; let mut value = Vec::new(); @@ -246,7 +245,6 @@ fn parse_atom_fn_params(node: &AstNode) -> Result, CstPa name: param_counter.to_string(), value, }); - param_counter += 1; } Ok(buf)