Main function
This commit is contained in:
+4
-1
@@ -21,7 +21,10 @@ pub fn walk_ast(top_scope: Arc<Scope>, tl: &mut Vec<parser::ast::TopLevel>) {
|
|||||||
params, body, name, ..
|
params, body, name, ..
|
||||||
} => {
|
} => {
|
||||||
let rf = top_scope.get_reference(name).unwrap();
|
let rf = top_scope.get_reference(name).unwrap();
|
||||||
*name = rf.name.clone();
|
|
||||||
|
if name != "main" {
|
||||||
|
*name = rf.name.clone();
|
||||||
|
}
|
||||||
|
|
||||||
match &*rf.var_type {
|
match &*rf.var_type {
|
||||||
hir::TypeRef::Function(f) => walk_param_list(&f.params, params),
|
hir::TypeRef::Function(f) => walk_param_list(&f.params, params),
|
||||||
|
|||||||
+2
-4
@@ -1,7 +1,5 @@
|
|||||||
package main;
|
package main;
|
||||||
|
|
||||||
export struct MyType {
|
function main() {
|
||||||
export x: int,
|
let a = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function test(a: MyType) { }
|
|
||||||
|
|||||||
Reference in New Issue
Block a user