diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-07-21 11:25:49 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-07-21 11:28:33 +0200 |
| commit | b0e5212973ce2efcb1433323d67c06eea1a81785 (patch) | |
| tree | 3b040a4e23d2d99157050d95b67376b2fb866618 /src/eval | |
| parent | 9488b1b850152eb564dbfefc898c962bdac73eb4 (diff) | |
Fs builder methods + tidy up
Diffstat (limited to 'src/eval')
| -rw-r--r-- | src/eval/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/eval/mod.rs b/src/eval/mod.rs index 0efaaa90..9ec33b13 100644 --- a/src/eval/mod.rs +++ b/src/eval/mod.rs @@ -36,8 +36,8 @@ use crate::syntax::*; use crate::Context; /// Evaluate a parsed source file into a module. -pub fn eval(ctx: &mut Context, location: FileId, ast: Rc<SyntaxTree>) -> Pass<Module> { - let mut ctx = EvalContext::new(ctx, location); +pub fn eval(ctx: &mut Context, file: FileId, ast: Rc<SyntaxTree>) -> Pass<Module> { + let mut ctx = EvalContext::new(ctx, file); let template = ast.eval(&mut ctx); let module = Module { scope: ctx.scopes.top, template }; Pass::new(module, ctx.diags) @@ -70,13 +70,13 @@ pub struct EvalContext<'a> { impl<'a> EvalContext<'a> { /// Create a new evaluation context. - pub fn new(ctx: &'a mut Context, location: FileId) -> Self { + pub fn new(ctx: &'a mut Context, file: FileId) -> Self { Self { loader: ctx.loader.as_ref(), images: &mut ctx.images, scopes: Scopes::new(Some(&ctx.std)), diags: DiagSet::new(), - route: vec![location], + route: vec![file], modules: HashMap::new(), } } |
