diff --git a/src/protocol/parser/pass_definitions.rs b/src/protocol/parser/pass_definitions.rs index 303d9ec425c5551f0e2a93ea8ba656fd2d27687a..8ce576bcfa720aef0e2e4d9701150fb216f14b7a 100644 --- a/src/protocol/parser/pass_definitions.rs +++ b/src/protocol/parser/pass_definitions.rs @@ -759,7 +759,7 @@ impl PassDefinitions { if let Expression::Call(expression) = expression { // Allow both components and functions, as it makes more sense to // check their correct use in the validation and linking pass - if expression.method == Method::UserComponent || expression.method == Method::UserProcedure { + if expression.method == Method::UserComponent || expression.method == Method::UserFunction { call_id = expression.this; valid = true; } @@ -924,7 +924,7 @@ impl PassDefinitions { declaration: Some(local_id), used_as_binding_target: false, parent: ExpressionParent::None, - unique_id_in_definition: -1, + type_index: -1, }); let assignment_expr_id = ctx.heap.alloc_assignment_expression(|this| AssignmentExpression{ this, @@ -934,7 +934,7 @@ impl PassDefinitions { operation: AssignmentOperator::Set, right: initial_expr_id, parent: ExpressionParent::None, - unique_id_in_definition: -1, + type_index: -1, }); // Put both together in the memory statement @@ -1029,7 +1029,7 @@ impl PassDefinitions { Ok(ctx.heap.alloc_assignment_expression(|this| AssignmentExpression{ this, operator_span, full_span, left, operation, right, parent: ExpressionParent::None, - unique_id_in_definition: -1, + type_index: -1, }).upcast()) } else { Ok(expr) @@ -1057,7 +1057,7 @@ impl PassDefinitions { Ok(ctx.heap.alloc_conditional_expression(|this| ConditionalExpression{ this, operator_span, full_span, test, true_expression, false_expression, parent: ExpressionParent::None, - unique_id_in_definition: -1, + type_index: -1, }).upcast()) } else { Ok(result) @@ -1242,7 +1242,7 @@ impl PassDefinitions { Ok(ctx.heap.alloc_unary_expression(|this| UnaryExpression { this, operator_span, full_span, operation, expression, parent: ExpressionParent::None, - unique_id_in_definition: -1, + type_index: -1, }).upcast()) } else if next == Some(TokenKind::PlusPlus) { return Err(ParseError::new_error_str_at_span( @@ -1306,7 +1306,7 @@ impl PassDefinitions { slicing_span: operator_span, full_span, subject, from_index, to_index, parent: ExpressionParent::None, - unique_id_in_definition: -1, + type_index: -1, }).upcast(); } else if Some(TokenKind::CloseSquare) == next { let end_span = consume_token(&module.source, iter, TokenKind::CloseSquare)?; @@ -1320,7 +1320,7 @@ impl PassDefinitions { this, operator_span, full_span, subject, index: from_index, parent: ExpressionParent::None, - unique_id_in_definition: -1, + type_index: -1, }).upcast(); } else { return Err(ParseError::new_error_str_at_pos( @@ -1361,7 +1361,7 @@ impl PassDefinitions { this, operator_span, full_span, subject, kind: select_kind, parent: ExpressionParent::None, - unique_id_in_definition: -1, + type_index: -1, }).upcast(); } @@ -1397,7 +1397,7 @@ impl PassDefinitions { span: InputSpan::from_positions(open_paren_pos, close_paren_pos), value: Literal::Tuple(Vec::new()), parent: ExpressionParent::None, - unique_id_in_definition: -1, + type_index: -1, }); literal_id.upcast() @@ -1423,7 +1423,7 @@ impl PassDefinitions { span: InputSpan::from_positions(open_paren_pos, close_paren_pos), value: Literal::Tuple(scoped_section.into_vec()), parent: ExpressionParent::None, - unique_id_in_definition: -1, + type_index: -1, }); literal_id.upcast() @@ -1451,7 +1451,7 @@ impl PassDefinitions { span: InputSpan::from_positions(start_pos, end_pos), value: Literal::Array(scoped_section.into_vec()), parent: ExpressionParent::None, - unique_id_in_definition: -1, + type_index: -1, }).upcast() } else if next == Some(TokenKind::Integer) { let (literal, span) = consume_integer_literal(&module.source, iter, &mut self.buffer)?; @@ -1460,7 +1460,7 @@ impl PassDefinitions { this, span, value: Literal::Integer(LiteralInteger{ unsigned_value: literal, negated: false }), parent: ExpressionParent::None, - unique_id_in_definition: -1, + type_index: -1, }).upcast() } else if next == Some(TokenKind::String) { let span = consume_string_literal(&module.source, iter, &mut self.buffer)?; @@ -1470,7 +1470,7 @@ impl PassDefinitions { this, span, value: Literal::String(interned), parent: ExpressionParent::None, - unique_id_in_definition: -1, + type_index: -1, }).upcast() } else if next == Some(TokenKind::Character) { let (character, span) = consume_character_literal(&module.source, iter)?; @@ -1479,7 +1479,7 @@ impl PassDefinitions { this, span, value: Literal::Character(character), parent: ExpressionParent::None, - unique_id_in_definition: -1, + type_index: -1, }).upcast() } else if next == Some(TokenKind::Ident) { // May be a variable, a type instantiation or a function call. If we @@ -1531,7 +1531,7 @@ impl PassDefinitions { definition: target_definition_id, }), parent: ExpressionParent::None, - unique_id_in_definition: -1, + type_index: -1, }).upcast() }, Definition::Enum(_) => { @@ -1549,7 +1549,7 @@ impl PassDefinitions { variant_idx: 0 }), parent: ExpressionParent::None, - unique_id_in_definition: -1, + type_index: -1, }).upcast() }, Definition::Union(_) => { @@ -1574,7 +1574,7 @@ impl PassDefinitions { variant_idx: 0, }), parent: ExpressionParent::None, - unique_id_in_definition: -1, + type_index: -1, }).upcast() }, Definition::Procedure(proc_def) => { @@ -1592,7 +1592,7 @@ impl PassDefinitions { _ => unreachable!(), } } else if proc_def.kind == ProcedureKind::Function { - Method::UserProcedure + Method::UserFunction } else { Method::UserComponent }; @@ -1608,7 +1608,7 @@ impl PassDefinitions { this, func_span, full_span, parser_type, method, arguments, procedure: procedure_id, parent: ExpressionParent::None, - unique_id_in_definition: -1, + type_index: -1, }).upcast() } } @@ -1637,7 +1637,7 @@ impl PassDefinitions { span: ident_span, value, parent: ExpressionParent::None, - unique_id_in_definition: -1, + type_index: -1, }).upcast() } else if ident_text == KW_LET { // Binding expression @@ -1655,7 +1655,7 @@ impl PassDefinitions { ctx.heap.alloc_binding_expression(|this| BindingExpression{ this, operator_span, full_span, bound_to, bound_from, parent: ExpressionParent::None, - unique_id_in_definition: -1, + type_index: -1, }).upcast() } else if ident_text == KW_CAST { // Casting expression @@ -1692,7 +1692,7 @@ impl PassDefinitions { cast_span: to_type.full_span, full_span, to_type, subject, parent: ExpressionParent::None, - unique_id_in_definition: -1, + type_index: -1, }).upcast() } else { // Not a builtin literal, but also not a known type. So we @@ -1727,7 +1727,7 @@ impl PassDefinitions { declaration: None, used_as_binding_target: false, parent: ExpressionParent::None, - unique_id_in_definition: -1, + type_index: -1, }).upcast() } } @@ -1767,7 +1767,7 @@ impl PassDefinitions { result = ctx.heap.alloc_binary_expression(|this| BinaryExpression{ this, operator_span, full_span, left, operation, right, parent: ExpressionParent::None, - unique_id_in_definition: -1, + type_index: -1, }).upcast(); }