FIX: import cycle detection which was broken.

This commit is contained in:
Jeremy Wall 2019-03-28 20:38:02 -04:00
parent 76899cb481
commit 2e38a3486e
4 changed files with 7 additions and 3 deletions

View File

@ -1 +1 @@
import "import_cycle2.ucg" as cycle2; let cycle2 = import "import_cycle2.ucg";

View File

@ -1 +1 @@
import "import_cycle3.ucg" as cycle3; let cycle3 = import "import_cycle3.ucg";

View File

@ -1 +1 @@
import "import_cycle1.ucg" as cycle1; let cycle1 = import "import_cycle1.ucg";

View File

@ -465,6 +465,10 @@ impl<'a> FileBuilder<'a> {
Some(v) => v.clone(), Some(v) => v.clone(),
None => { None => {
let mut b = self.clone_builder(); let mut b = self.clone_builder();
b.scope
.import_stack
.push(normalized.to_string_lossy().to_string());
match b.build(&normalized) { match b.build(&normalized) {
Ok(_) => b.get_outputs_as_val(), Ok(_) => b.get_outputs_as_val(),
Err(e) => { Err(e) => {