CHECKPOINT: Everything builds again.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use super::ast::{Expression, Program, TopLevel};
|
||||
use super::ast::{Expression, Program};
|
||||
use internment::ArcIntern;
|
||||
use std::collections::HashSet;
|
||||
|
||||
@@ -10,23 +10,14 @@ impl<T> Program<T> {
|
||||
pub fn strings(&self) -> HashSet<ArcIntern<String>> {
|
||||
let mut result = HashSet::new();
|
||||
|
||||
for stmt in self.items.iter() {
|
||||
stmt.register_strings(&mut result);
|
||||
for function in self.functions.values() {
|
||||
function.body.register_strings(&mut result);
|
||||
}
|
||||
|
||||
result
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> TopLevel<T> {
|
||||
fn register_strings(&self, string_set: &mut HashSet<ArcIntern<String>>) {
|
||||
match self {
|
||||
TopLevel::Function(_, _, _, body) => body.register_strings(string_set),
|
||||
TopLevel::Statement(stmt) => stmt.register_strings(string_set),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Expression<T> {
|
||||
fn register_strings(&self, _string_set: &mut HashSet<ArcIntern<String>>) {
|
||||
// nothing has a string in here, at the moment
|
||||
|
||||
Reference in New Issue
Block a user