Match and consume a Uimm32 immediate.
(&mut self, err_msg: &str)
| 755 | |
| 756 | // Match and consume a Uimm32 immediate. |
| 757 | fn match_uimm32(&mut self, err_msg: &str) -> ParseResult<Uimm32> { |
| 758 | if let Some(Token::Integer(text)) = self.token() { |
| 759 | self.consume(); |
| 760 | // Lexer just gives us raw text that looks like an integer. |
| 761 | // Parse it as an Uimm32 to check for overflow and other issues. |
| 762 | text.parse().map_err(|e| self.error(e)) |
| 763 | } else { |
| 764 | err!(self.loc, err_msg) |
| 765 | } |
| 766 | } |
| 767 | |
| 768 | // Match and consume a u8 immediate. |
| 769 | // This is used for lane numbers in SIMD vectors. |
no test coverage detected