Skip to content

Commit

Permalink
Support disabling lexical scope via CLI options
Browse files Browse the repository at this point in the history
  • Loading branch information
rdaum committed Aug 13, 2024
1 parent b33c771 commit 1f374d0
Show file tree
Hide file tree
Showing 22 changed files with 1,229 additions and 999 deletions.
6 changes: 3 additions & 3 deletions crates/compiler/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use crate::labels::{JumpLabel, Label, Offset};
use crate::names::{Name, Names, UnboundName};
use crate::opcode::Op::Jump;
use crate::opcode::{Op, ScatterArgs, ScatterLabel};
use crate::parse::parse_program;
use crate::parse::{parse_program, CompileOptions};
use crate::program::Program;
use moor_values::model::CompileError;

Expand Down Expand Up @@ -841,12 +841,12 @@ impl CodegenState {
}
}

pub fn compile(program: &str) -> Result<Program, CompileError> {
pub fn compile(program: &str, options: CompileOptions) -> Result<Program, CompileError> {
let compile_span = tracing::trace_span!("compile");
let _compile_guard = compile_span.enter();

let builtins = make_builtin_offsets();
let parse = parse_program(program)?;
let parse = parse_program(program, options)?;

// Generate the code into 'cg_state'.
let mut cg_state = CodegenState::new(parse.names, parse.names_mapping, builtins);
Expand Down
Loading

0 comments on commit 1f374d0

Please sign in to comment.