forked from M-Labs/nac3
[core] Add generator to SymbolResolver::get_symbol_value
Needed in a future commit.
This commit is contained in:
parent
8065e73598
commit
9fdbe9695d
|
@ -1470,6 +1470,7 @@ impl SymbolResolver for Resolver {
|
|||
&self,
|
||||
id: StrRef,
|
||||
_: &mut CodeGenContext<'ctx, '_>,
|
||||
_: &mut dyn CodeGenerator,
|
||||
) -> Option<ValueEnum<'ctx>> {
|
||||
let sym_value = {
|
||||
let id_to_val = self.0.id_to_pyval.read();
|
||||
|
|
|
@ -2886,7 +2886,7 @@ pub fn gen_expr<'ctx, G: CodeGenerator>(
|
|||
Some((_, Some(static_value), _)) => ValueEnum::Static(static_value.clone()),
|
||||
None => {
|
||||
let resolver = ctx.resolver.clone();
|
||||
resolver.get_symbol_value(*id, ctx).unwrap()
|
||||
resolver.get_symbol_value(*id, ctx, generator).unwrap()
|
||||
}
|
||||
},
|
||||
ExprKind::List { elts, .. } => {
|
||||
|
|
|
@ -67,6 +67,7 @@ impl SymbolResolver for Resolver {
|
|||
&self,
|
||||
_: StrRef,
|
||||
_: &mut CodeGenContext<'ctx, '_>,
|
||||
_: &mut dyn CodeGenerator,
|
||||
) -> Option<ValueEnum<'ctx>> {
|
||||
unimplemented!()
|
||||
}
|
||||
|
|
|
@ -369,6 +369,7 @@ pub trait SymbolResolver {
|
|||
&self,
|
||||
str: StrRef,
|
||||
ctx: &mut CodeGenContext<'ctx, '_>,
|
||||
generator: &mut dyn CodeGenerator,
|
||||
) -> Option<ValueEnum<'ctx>>;
|
||||
|
||||
fn get_default_param_value(&self, expr: &Expr) -> Option<SymbolValue>;
|
||||
|
|
|
@ -65,6 +65,7 @@ impl SymbolResolver for Resolver {
|
|||
&self,
|
||||
_: StrRef,
|
||||
_: &mut CodeGenContext<'ctx, '_>,
|
||||
_: &mut dyn CodeGenerator,
|
||||
) -> Option<ValueEnum<'ctx>> {
|
||||
unimplemented!()
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ use nac3parser::{ast::FileName, parser::parse_program};
|
|||
|
||||
use super::*;
|
||||
use crate::{
|
||||
codegen::CodeGenContext,
|
||||
codegen::{CodeGenContext, CodeGenerator},
|
||||
symbol_resolver::ValueEnum,
|
||||
toplevel::{helper::PrimDef, DefinitionId, TopLevelDef},
|
||||
typecheck::{magic_methods::with_fields, typedef::*},
|
||||
|
@ -43,6 +43,7 @@ impl SymbolResolver for Resolver {
|
|||
&self,
|
||||
_: StrRef,
|
||||
_: &mut CodeGenContext<'ctx, '_>,
|
||||
_: &mut dyn CodeGenerator,
|
||||
) -> Option<ValueEnum<'ctx>> {
|
||||
unimplemented!()
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ use std::{
|
|||
use parking_lot::{Mutex, RwLock};
|
||||
|
||||
use nac3core::{
|
||||
codegen::CodeGenContext,
|
||||
codegen::{CodeGenContext, CodeGenerator},
|
||||
nac3parser::ast::{self, StrRef},
|
||||
symbol_resolver::{SymbolResolver, SymbolValue, ValueEnum},
|
||||
toplevel::{DefinitionId, TopLevelDef},
|
||||
|
@ -61,6 +61,7 @@ impl SymbolResolver for Resolver {
|
|||
&self,
|
||||
_: StrRef,
|
||||
_: &mut CodeGenContext<'ctx, '_>,
|
||||
_: &mut dyn CodeGenerator,
|
||||
) -> Option<ValueEnum<'ctx>> {
|
||||
unimplemented!()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue