cas_compiler/expr/range.rs
1use cas_error::Error;
2use cas_parser::parser::ast::range::Range;
3use crate::{Compile, Compiler, InstructionKind};
4
5impl Compile for Range {
6 fn compile(&self, compiler: &mut Compiler) -> Result<(), Error> {
7 self.start.compile(compiler)?;
8 self.end.compile(compiler)?;
9 compiler.add_instr(InstructionKind::CreateRange(self.kind));
10 Ok(())
11 }
12}