|
|
@ -71,6 +71,16 @@ impl CrsnExtension for BuiltinOps { |
|
|
|
return Ok(ParseRes::ParsedNone); |
|
|
|
return Ok(ParseRes::ParsedNone); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"unsym" => { |
|
|
|
|
|
|
|
let alias = parse_reg_alias(args.next())?; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let mut pstate = pcx.state.borrow_mut(); |
|
|
|
|
|
|
|
if pstate.reg_aliases.remove(&alias).is_none() { |
|
|
|
|
|
|
|
return Err(CrsnError::Parse(format!("Register alias \"{}\" not defined!", alias).into())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return Ok(ParseRes::ParsedNone); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
"def" => { |
|
|
|
"def" => { |
|
|
|
let name = parse_constant_name(args.next())?; |
|
|
|
let name = parse_constant_name(args.next())?; |
|
|
|
let value = parse_value(args.next())?; |
|
|
|
let value = parse_value(args.next())?; |
|
|
@ -89,6 +99,16 @@ impl CrsnExtension for BuiltinOps { |
|
|
|
return Ok(ParseRes::ParsedNone); |
|
|
|
return Ok(ParseRes::ParsedNone); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"undef" => { |
|
|
|
|
|
|
|
let name = parse_constant_name(args.next())?; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let mut pstate = pcx.state.borrow_mut(); |
|
|
|
|
|
|
|
if pstate.constants.remove(&name).is_none() { |
|
|
|
|
|
|
|
return Err(CrsnError::Parse(format!("Constant \"{}\" not defined!", name).into())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return Ok(ParseRes::ParsedNone); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
"j" => { |
|
|
|
"j" => { |
|
|
|
let dest = parse_label(args.next())?; |
|
|
|
let dest = parse_label(args.next())?; |
|
|
|
BuiltinOp::Jump(dest) |
|
|
|
BuiltinOp::Jump(dest) |
|
|
|