use crsn::asm::error::CrsnError; use crsn::asm::instr::Op; use crsn::asm::parse::arg_parser::ArgParser; use crsn::module::{ParseOpRes}; use crate::defs::ScreenOp; pub(crate) fn parse(keyword: &str, mut args: ArgParser) -> Result, CrsnError> { Ok(ParseOpRes::ext(match keyword { "sc-init" => { ScreenOp::ScreenInit { width: args.next_rd()?, height: args.next_rd()?, } } "sc-px" => { ScreenOp::SetPixel { x: args.next_rd()?, y: args.next_rd()?, color: args.next_rd()?, } } _other => { return Ok(ParseOpRes::Unknown(args)); } })) }