Use interned strings for AST nodes.

This commit is contained in:
Stephen Chung
2022-08-13 18:07:42 +08:00
parent 1c7b80ed13
commit 28743594d0
11 changed files with 147 additions and 205 deletions

View File

@@ -143,7 +143,7 @@ fn collect_fn_metadata(
if !namespace.is_empty() {
map.insert("namespace".into(), dict.get(namespace).into());
}
map.insert("name".into(), dict.get(&func.name).into());
map.insert("name".into(), dict.get(func.name.as_str()).into());
map.insert(
"access".into(),
dict.get(match func.access {
@@ -160,7 +160,7 @@ fn collect_fn_metadata(
"params".into(),
func.params
.iter()
.map(|p| dict.get(p).into())
.map(|p| dict.get(p.as_str()).into())
.collect::<Array>()
.into(),
);