@@ -9,16 +9,17 @@ use mango::towasm::Wasm;
9
9
use std:: fs:: File ;
10
10
use std:: io;
11
11
use std:: io:: Write ;
12
+ use std:: rc:: Rc ;
12
13
13
14
pub struct Parameter {
14
15
// Don't box here, it's just to reference those fields
15
16
declare_local : DeclareLocal ,
16
17
}
17
18
18
19
impl Parameter {
19
- pub fn new ( name : Name , typ : Type ) -> Box < Self > {
20
+ pub fn new ( name : Rc < Name > , typ : Type ) -> Box < Self > {
20
21
// todo: should this store declare local AND name/type?
21
- let declare_local = DeclareLocal :: new_unboxed ( name. clone ( ) , typ. clone ( ) ) ;
22
+ let declare_local = DeclareLocal :: new_unboxed ( name, typ. clone ( ) ) ;
22
23
Box :: new ( Parameter { declare_local } )
23
24
}
24
25
@@ -66,13 +67,13 @@ impl Wasm for Output {
66
67
}
67
68
68
69
pub struct FunctionSignature {
69
- name : Name ,
70
+ name : Rc < Name > ,
70
71
parameters : Vec < Box < Parameter > > ,
71
72
results : Vec < Box < Output > > ,
72
73
}
73
74
74
75
impl FunctionSignature {
75
- pub fn new ( name : Name , parameters : Vec < Box < Parameter > > , results : Vec < Box < Output > > ) -> Self {
76
+ pub fn new ( name : Rc < Name > , parameters : Vec < Box < Parameter > > , results : Vec < Box < Output > > ) -> Self {
76
77
assert ! ( results. len( ) <= 1 ) ; //
77
78
FunctionSignature {
78
79
name,
@@ -114,7 +115,7 @@ pub struct Function {
114
115
impl Function {
115
116
// This uses group, so it has a label, but this isn't final... It might be useless.
116
117
pub fn new (
117
- name : Name ,
118
+ name : Rc < Name > ,
118
119
parameters : Vec < Box < Parameter > > ,
119
120
results : Vec < Box < Output > > ,
120
121
statements_gen : & Fn ( Label ) -> Vec < Box < Statement > > ,
0 commit comments