Skip to content

Commit 5830161

Browse files
refactor(wheel_semantic): adapt to SmallVec storage and add ManualDeclaration type
- Update argument array access to use .data() method for SmallVec compatibility - Add case handling for ManualDeclaration builtin type in type resolution
1 parent 7e4db04 commit 5830161

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

wheel_semantic/semantic.cxx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,10 @@ bool SemanticAnalyzer::resolve_type(SymbolID type_symbol, ValueKind &type_kind)
176176
return true;
177177
case wheel_parser::ast::BuiltinType::Count:
178178
break;
179-
}
179+
180+
case wheel_parser::ast::BuiltinType::ManualDeclaration:
181+
break;
182+
}
180183

181184
return false;
182185
}
@@ -335,7 +338,7 @@ bool SemanticAnalyzer::analyze_call_expression(
335338
return false;
336339
}
337340

338-
const ExpressionNode *format_expression = expression->arguments[0];
341+
const ExpressionNode *format_expression = expression->arguments.data()[0];
339342
if (format_expression == nullptr || format_expression->token == nullptr ||
340343
format_expression->node_kind != NodeKind::LiteralExpression) {
341344
push_error(SemanticErrorCode::InvalidFormatString, statement_token);
@@ -370,7 +373,7 @@ bool SemanticAnalyzer::analyze_call_expression(
370373
for (size_t index = 1; index < argument_count; ++index) {
371374
Operand runtime_argument = Operand::from_constant(nullptr, Value::from_int(0));
372375
ValueKind argument_type = ValueKind::Int;
373-
if (!build_operand(expression->arguments[index], runtime_argument, argument_type)) {
376+
if (!build_operand(expression->arguments.data()[index], runtime_argument, argument_type)) {
374377
return false;
375378
}
376379

0 commit comments

Comments
 (0)