mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Support !
in symbols provided to host
This commit is contained in:
parent
b80f44738f
commit
75856ae804
3 changed files with 10 additions and 10 deletions
|
@ -4646,7 +4646,7 @@ impl LayoutId {
|
|||
// Returns something like "#UserApp_foo_1" when given a symbol that interns to "foo"
|
||||
// and a LayoutId of 1.
|
||||
pub fn to_symbol_string(self, symbol: Symbol, interns: &Interns) -> String {
|
||||
let ident_string = symbol.as_str(interns);
|
||||
let ident_string = symbol.as_str(interns).trim_end_matches('!');
|
||||
let module_string = interns.module_ids.get_name(symbol.module_id()).unwrap();
|
||||
format!("{}_{}_{}", module_string, ident_string, self.0)
|
||||
}
|
||||
|
@ -4654,12 +4654,12 @@ impl LayoutId {
|
|||
// Returns something like "roc__foo_1_exposed" when given a symbol that interns to "foo"
|
||||
// and a LayoutId of 1.
|
||||
pub fn to_exposed_symbol_string(self, symbol: Symbol, interns: &Interns) -> String {
|
||||
let ident_string = symbol.as_str(interns);
|
||||
let ident_string = symbol.as_str(interns).trim_end_matches('!');
|
||||
format!("roc__{}_{}_exposed", ident_string, self.0)
|
||||
}
|
||||
|
||||
pub fn to_exposed_generic_symbol_string(self, symbol: Symbol, interns: &Interns) -> String {
|
||||
let ident_string = symbol.as_str(interns);
|
||||
let ident_string = symbol.as_str(interns).trim_end_matches('!');
|
||||
format!("roc__{}_{}_exposed_generic", ident_string, self.0)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
platform "effects"
|
||||
requires {} { main : {} => {} }
|
||||
requires {} { main! : {} => {} }
|
||||
exposes []
|
||||
packages {}
|
||||
imports []
|
||||
provides [mainForHost]
|
||||
provides [mainForHost!]
|
||||
|
||||
mainForHost : {} => {}
|
||||
mainForHost = \{} -> main {}
|
||||
mainForHost! : {} => {}
|
||||
mainForHost! = \{} -> main! {}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
app [main] { pf: platform "effects-platform/main.roc" }
|
||||
app [main!] { pf: platform "effects-platform/main.roc" }
|
||||
|
||||
import pf.Effect
|
||||
|
||||
main : {} => {}
|
||||
main = \{} ->
|
||||
main! : {} => {}
|
||||
main! = \{} ->
|
||||
line = Effect.getLine! {}
|
||||
|
||||
if line == "secret" then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue