Compare commits
2 Commits
c43be7388d
...
2ec449545e
Author | SHA1 | Date |
---|---|---|
z78078 | 2ec449545e | |
z78078 | 6eb433b2e3 |
|
@ -37,7 +37,7 @@ pub struct TopLevelComposer {
|
||||||
// number of built-in function and classes in the definition list, later skip
|
// number of built-in function and classes in the definition list, later skip
|
||||||
pub builtin_num: usize,
|
pub builtin_num: usize,
|
||||||
pub core_config: ComposerConfig,
|
pub core_config: ComposerConfig,
|
||||||
// the class name and it's constructor function
|
// the class name and its constructor function
|
||||||
pub constructor_lookup: HashMap<StrRef, ast::Located<ast::StmtKind>>,
|
pub constructor_lookup: HashMap<StrRef, ast::Located<ast::StmtKind>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ impl TopLevelComposer {
|
||||||
return Some((**class_name, stmt.clone()))
|
return Some((**class_name, stmt.clone()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return None
|
None
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -706,8 +706,9 @@ fn test_build_constructor_lookup(source: &str, result: HashMap<ast::StrRef, ast:
|
||||||
composer.build_constructor_lookup(stmts.iter())
|
composer.build_constructor_lookup(stmts.iter())
|
||||||
}
|
}
|
||||||
|
|
||||||
assert_eq!(result.get(&"A".into()).unwrap(), result.get(&"B".into()).unwrap());
|
assert_eq!(result.get(&"A".into()).unwrap(), composer.constructor_lookup.get(&"A".into()).unwrap());
|
||||||
assert_eq!(result.get(&"B".into()).unwrap(), result.get(&"C".into()).unwrap());
|
assert_eq!(result.get(&"B".into()).unwrap(), composer.constructor_lookup.get(&"B".into()).unwrap());
|
||||||
|
assert_eq!(result.get(&"C".into()).unwrap(), composer.constructor_lookup.get(&"C".into()).unwrap());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue