Skip to content

Commit

Permalink
Remove export from pool size constant
Browse files Browse the repository at this point in the history
  • Loading branch information
evie-calico committed Mar 9, 2024
1 parent 7510edd commit 29e169d
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1512,21 +1512,12 @@ fn compile_ast<W: Write>(
type_table: &mut TypeTable,
output: &mut W,
options: &CompilerOptions,
// Only true if this file was not `include`d.
// Used for outputting pool sizes.
is_root: bool,
) -> Result<(), CompilerError> {
for i in ast {
match i {
types::Root::Environment(name, env) => {
let new_env = compile_environment(&name, env, environment_table, output)?;
if is_root {
writeln!(
output,
"def {name}__pool_size equ {}\nexport {name}__pool_size",
new_env.pool
)?;
}
writeln!(output, "def {name}__pool_size equ {}", new_env.pool)?;
environment_table.insert(name, new_env);
}
types::Root::Function(name, func) => {
Expand All @@ -1552,9 +1543,7 @@ fn compile_ast<W: Write>(
}
};

if let Err(err) =
compile_ast(ast, environment_table, type_table, output, options, false)
{
if let Err(err) = compile_ast(ast, environment_table, type_table, output, options) {
eprintln!("{path}: {err}");
exit(1);
}
Expand Down Expand Up @@ -1611,7 +1600,6 @@ pub fn compile<W: Write>(
&mut type_table,
output,
&options,
true,
)?;
Ok(())
}

0 comments on commit 29e169d

Please sign in to comment.