File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -227,10 +227,21 @@ impl Compiler2 {
227227 }
228228
229229 pub fn check(&mut self) -> bool {
230+
231+ let mut decls = vec![];
232+ for tree in &self.ast {
233+ decls.append(&mut tree.decls.clone());
234+ }
235+
236+ self.decls = DeclTable::new(decls);
237+
230238 let mut checker = Checker::new();
231239
240+ println!("Checking program...");
241+
232242 for tree in &self.ast {
233243 for decl in &tree.decls {
244+ println!("Checking decl: {:?}...", decl);
234245 checker.check_decl(decl, &self.decls);
235246 }
236247 }
@@ -322,13 +333,22 @@ impl Default for Compiler {
322333mod tests {
323334
324335 fn jit(code: &str) {
336+
337+ let mut compiler = crate::Compiler2::new();
338+ let paths = vec![String::from(".")];
339+
340+ compiler.parse(code.into(), &paths[0]);
341+ compiler.check();
342+ // compiler.jit();
343+
344+ /*
325345 let mut compiler = crate::Compiler::new();
326346 let paths = vec![String::from(".")];
327347
328348 compiler.update_path(&paths[0], code.into());
329349 compiler.set_paths(paths);
330350
331- compiler.jit();
351+ compiler.jit();*/
332352 }
333353
334354 #[test]
You can’t perform that action at this time.
0 commit comments