Match and consume a Uimm64 immediate.
(&mut self, err_msg: &str)
| 742 | |
| 743 | // Match and consume a Uimm64 immediate. |
| 744 | fn match_uimm64(&mut self, err_msg: &str) -> ParseResult<Uimm64> { |
| 745 | if let Some(Token::Integer(text)) = self.token() { |
| 746 | self.consume(); |
| 747 | // Lexer just gives us raw text that looks like an integer. |
| 748 | // Parse it as an Uimm64 to check for overflow and other issues. |
| 749 | text.parse() |
| 750 | .map_err(|_| self.error("expected u64 decimal immediate")) |
| 751 | } else { |
| 752 | err!(self.loc, err_msg) |
| 753 | } |
| 754 | } |
| 755 | |
| 756 | // Match and consume a Uimm32 immediate. |
| 757 | fn match_uimm32(&mut self, err_msg: &str) -> ParseResult<Uimm32> { |
no test coverage detected