refactor(compiler): remove statement count helpers
This commit is contained in:
@@ -2,12 +2,6 @@ use crate::compiler::{CompileCtx, Compiler};
|
||||
use oxide_parser::Statement;
|
||||
|
||||
impl Compiler {
|
||||
fn count_block_statement(&self, block: &oxide_parser::BlockStatement<'_>, ctx: &mut CompileCtx) {
|
||||
for s in &block.body {
|
||||
self.count_statement(s, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
fn emit_block_statement(&self, stmt: &Statement, ctx: &mut CompileCtx) -> Result<Option<u8>, String> {
|
||||
let Statement::BlockStatement(block) = stmt else {
|
||||
return Ok(None);
|
||||
@@ -23,12 +17,6 @@ impl Compiler {
|
||||
Ok(r)
|
||||
}
|
||||
|
||||
pub(crate) fn count_block_domain(&self, stmt: &Statement, ctx: &mut CompileCtx) {
|
||||
if let Statement::BlockStatement(block) = stmt {
|
||||
self.count_block_statement(block, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn emit_block_domain(&self, stmt: &Statement, ctx: &mut CompileCtx) -> Result<Option<u8>, String> {
|
||||
match stmt {
|
||||
Statement::BlockStatement(_) => self.emit_block_statement(stmt, ctx),
|
||||
|
||||
Reference in New Issue
Block a user