Match and consume a hexadeximal immediate
(&mut self, err_msg: &str)
| 702 | |
| 703 | // Match and consume a hexadeximal immediate |
| 704 | fn match_hexadecimal_constant(&mut self, err_msg: &str) -> ParseResult<ConstantData> { |
| 705 | if let Some(Token::Integer(text)) = self.token() { |
| 706 | self.consume(); |
| 707 | text.parse().map_err(|e| { |
| 708 | self.error(&format!( |
| 709 | "expected hexadecimal immediate, failed to parse: {e}" |
| 710 | )) |
| 711 | }) |
| 712 | } else { |
| 713 | err!(self.loc, err_msg) |
| 714 | } |
| 715 | } |
| 716 | |
| 717 | // Match and consume either a hexadecimal Uimm128 immediate (e.g. 0x000102...) or its literal |
| 718 | // list form (e.g. [0 1 2...]). For convenience, since uimm128 values are stored in the |
no test coverage detected