contents declaration

This commit is contained in:
Fernando Herrera
2021-09-25 17:28:15 +01:00
parent 6387401041
commit d9c42eb194
3 changed files with 10 additions and 0 deletions

View File

@ -113,6 +113,11 @@ impl EngineState {
}
}
pub fn print_contents(&self) {
let string = String::from_utf8_lossy(&self.file_contents);
println!("{}", string);
}
pub fn find_decl(&self, name: &[u8]) -> Option<DeclId> {
for scope in self.scope.iter().rev() {
if let Some(decl_id) = scope.decls.get(name) {