mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
make effect name flexible
This commit is contained in:
parent
7a8e9fe343
commit
4b8392696e
2 changed files with 5 additions and 2 deletions
|
@ -2288,6 +2288,7 @@ fn fabricate_host_exposed_def<'a>(
|
||||||
scope: &mut roc_can::scope::Scope,
|
scope: &mut roc_can::scope::Scope,
|
||||||
module_id: ModuleId,
|
module_id: ModuleId,
|
||||||
symbol: Symbol,
|
symbol: Symbol,
|
||||||
|
ident: &str,
|
||||||
effect_tag_name: TagName,
|
effect_tag_name: TagName,
|
||||||
var_store: &mut VarStore,
|
var_store: &mut VarStore,
|
||||||
annotation: roc_can::annotation::Annotation,
|
annotation: roc_can::annotation::Annotation,
|
||||||
|
@ -2334,8 +2335,9 @@ fn fabricate_host_exposed_def<'a>(
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO figure out something better for run lowlevel
|
// TODO figure out something better for run lowlevel
|
||||||
|
let foreign_symbol_name = format!("roc_fx_{}", ident);
|
||||||
let low_level_call = Expr::ForeignCall {
|
let low_level_call = Expr::ForeignCall {
|
||||||
foreign_symbol: "roc_fx_put_char".into(),
|
foreign_symbol: foreign_symbol_name.into(),
|
||||||
args: linked_symbol_arguments,
|
args: linked_symbol_arguments,
|
||||||
ret_var: var_store.fresh(),
|
ret_var: var_store.fresh(),
|
||||||
};
|
};
|
||||||
|
@ -2622,6 +2624,7 @@ fn fabricate_effects_module<'a>(
|
||||||
&mut scope,
|
&mut scope,
|
||||||
module_id,
|
module_id,
|
||||||
symbol,
|
symbol,
|
||||||
|
ident.value,
|
||||||
TagName::Private(effect_symbol),
|
TagName::Private(effect_symbol),
|
||||||
&mut var_store,
|
&mut var_store,
|
||||||
annotation,
|
annotation,
|
||||||
|
|
|
@ -18,7 +18,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub fn roc_fx_put_char(foo: i64) -> () {
|
pub fn roc_fx_putChar(foo: i64) -> () {
|
||||||
let character = foo as u8 as char;
|
let character = foo as u8 as char;
|
||||||
print!("{}", character);
|
print!("{}", character);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue