Use roc__ prefix for exposed app functions

This commit is contained in:
Richard Feldman 2020-11-23 00:00:13 -05:00
parent 759c047b4c
commit 88d2ad1ffc
17 changed files with 50 additions and 30 deletions

View file

@ -1,4 +1,4 @@
app Main provides [ main ] imports [ Dep1 ] app "multi-dep-str" imports [ Dep1 ] provides [ main ] to "./platform"
main : Str main : Str
main = Dep1.str1 main = Dep1.str1

View file

@ -1,5 +1,7 @@
platform roc/quicksort platform examples/multi-module
provides [] requires { main : Str }
requires {} exposes []
packages {}
imports [] imports []
provides [ main ]
effects Effect {} effects Effect {}

View file

@ -3,7 +3,7 @@ use roc_std::RocStr;
use std::str; use std::str;
extern "C" { extern "C" {
#[link_name = "Main_main_1_exposed"] #[link_name = "roc__main_1_exposed"]
fn say_hello(output: &mut RocCallResult<RocStr>) -> (); fn say_hello(output: &mut RocCallResult<RocStr>) -> ();
} }

View file

@ -1,4 +1,4 @@
app "test-app" provides [ main ] imports [ Dep1 ] app "multi-dep-thunk" imports [ Dep1 ] provides [ main ] to "./platform"
main : Str main : Str
main = Dep1.value1 {} main = Dep1.value1 {}

View file

@ -1,5 +1,7 @@
platform roc/quicksort platform examples/multi-dep-thunk
provides [] requires { main : Str }
requires {} exposes []
packages {}
imports [] imports []
provides [ main ]
effects Effect {} effects Effect {}

View file

@ -3,7 +3,7 @@ use roc_std::RocStr;
use std::str; use std::str;
extern "C" { extern "C" {
#[link_name = "Main_main_1_exposed"] #[link_name = "roc__main_1_exposed"]
fn say_hello(output: &mut RocCallResult<RocStr>) -> (); fn say_hello(output: &mut RocCallResult<RocStr>) -> ();
} }

View file

@ -1707,7 +1707,8 @@ fn expose_function_to_host<'a, 'ctx, 'env>(
env: &Env<'a, 'ctx, 'env>, env: &Env<'a, 'ctx, 'env>,
roc_function: FunctionValue<'ctx>, roc_function: FunctionValue<'ctx>,
) { ) {
let c_function_name: String = format!("{}_exposed", roc_function.get_name().to_str().unwrap()); let c_function_name: String =
format!("roc_{}_exposed", roc_function.get_name().to_str().unwrap());
let result = expose_function_to_host_help(env, roc_function, &c_function_name); let result = expose_function_to_host_help(env, roc_function, &c_function_name);

View file

@ -1,5 +1,12 @@
platform roc/quicksort platform examples/closure
provides [] requires { main : Effect {} }
requires {} exposes []
packages {}
imports [] imports []
effects Effect {} provides [ mainForHost ]
effects Effect
{
putChar : Int -> Effect {},
putLine : Str -> Effect {},
getLine : Effect Str
}

View file

@ -1,7 +1,9 @@
platform folkertdev/foo platform folkertdev/foo
provides [ mainForHost ]
requires { main : Effect {} } requires { main : Effect {} }
exposes []
packages {}
imports [] imports []
provides [ mainForHost ]
effects Effect effects Effect
{ {
putChar : Int -> Effect {}, putChar : Int -> Effect {},

View file

@ -1,5 +1,7 @@
platform roc/quicksort platform examples/hello-world
provides [] requires { main : Str }
requires {} exposes []
packages {}
imports [] imports []
provides [ main ]
effects Effect {} effects Effect {}

View file

@ -3,7 +3,7 @@ use roc_std::RocStr;
use std::str; use std::str;
extern "C" { extern "C" {
#[link_name = "Hello_main_1_exposed"] #[link_name = "roc__main_1_exposed"]
fn say_hello(output: &mut RocCallResult<RocStr>) -> (); fn say_hello(output: &mut RocCallResult<RocStr>) -> ();
} }

View file

@ -1,5 +1,7 @@
platform roc/quicksort platform examples/multi-module
provides [] requires { quicksort : List (Num a) -> List (Num a) }
requires {} exposes []
packages {}
imports [] imports []
provides [ main ]
effects Effect {} effects Effect {}

View file

@ -3,7 +3,7 @@ use roc_std::RocList;
use std::time::SystemTime; use std::time::SystemTime;
extern "C" { extern "C" {
#[link_name = "Quicksort_quicksort_1_exposed"] #[link_name = "roc__quicksort_1_exposed"]
fn quicksort(list: RocList<i64>, output: &mut RocCallResult<RocList<i64>>) -> (); fn quicksort(list: RocList<i64>, output: &mut RocCallResult<RocList<i64>>) -> ();
} }

View file

@ -1,4 +1,4 @@
app "quicksort" provides [ main ] to "./platform" app "quicksort" provides [ quicksort ] to "./platform"
quicksort = \originalList -> quicksort = \originalList ->

View file

@ -1,5 +1,7 @@
platform roc/quicksort platform examples/quicksort
provides [] requires { quicksort : List (Num a) -> List (Num a) }
requires {} exposes []
packages {}
imports [] imports []
provides [ main ]
effects Effect {} effects Effect {}

View file

@ -3,7 +3,7 @@ use roc_std::RocList;
use std::time::SystemTime; use std::time::SystemTime;
extern "C" { extern "C" {
#[link_name = "Quicksort_quicksort_1_exposed"] #[link_name = "roc__quicksort_1_exposed"]
fn quicksort(list: RocList<i64>, output: &mut RocCallResult<RocList<i64>>) -> (); fn quicksort(list: RocList<i64>, output: &mut RocCallResult<RocList<i64>>) -> ();
} }

View file

@ -3,7 +3,7 @@ use roc_std::RocList;
use std::time::SystemTime; use std::time::SystemTime;
extern "C" { extern "C" {
#[link_name = "Main_quicksort_1_exposed"] #[link_name = "_quicksort_1_exposed"]
fn quicksort(list: RocList<i64>, output: &mut RocCallResult<RocList<i64>>) -> (); fn quicksort(list: RocList<i64>, output: &mut RocCallResult<RocList<i64>>) -> ();
} }