Skip to content

Commit

Permalink
update walk_call_expr for namer
Browse files Browse the repository at this point in the history
Signed-off-by: shruti2522 <[email protected]>
  • Loading branch information
shruti2522 committed Jun 2, 2024
1 parent 5bce49f commit 9bdabd5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions kclvm/sema/src/namer/node.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::core::package::ImportInfo;
use crate::core::symbol::{
AttributeSymbol, RuleSymbol, SchemaSymbol, SymbolKind, SymbolRef, TypeAliasSymbol, ValueSymbol,
AttributeSymbol, FunctionSymbol, RuleSymbol, SchemaSymbol, SymbolKind, SymbolRef,
TypeAliasSymbol, ValueSymbol,
};

use super::Namer;
Expand Down Expand Up @@ -255,8 +256,15 @@ impl<'ctx> MutSelfTypedResultWalker<'ctx> for Namer<'ctx> {
None
}

fn walk_call_expr(&mut self, _call_expr: &'ctx ast::CallExpr) -> Self::Result {
None
fn walk_call_expr(&mut self, call_expr: &'ctx ast::CallExpr) -> Self::Result {
let (start_pos, end_pos): Range = call_expr.func.get_span_pos();
let owner = self.ctx.owner_symbols.last().unwrap().clone();
let func_name = call_expr.func.node.get_expr_name();
let func_ref = self.gs.get_symbols_mut().alloc_function_symbol(
FunctionSymbol::new(func_name, start_pos, end_pos, Some(owner), true),
self.ctx.get_node_key(&call_expr.func.id),
);
Some(vec![func_ref])
}

fn walk_subscript(&mut self, _subscript: &'ctx ast::Subscript) -> Self::Result {
Expand Down

0 comments on commit 9bdabd5

Please sign in to comment.