Match and consume an Imm64 immediate.
(&mut self, err_msg: &str)
| 690 | |
| 691 | // Match and consume an Imm64 immediate. |
| 692 | fn match_imm64(&mut self, err_msg: &str) -> ParseResult<Imm64> { |
| 693 | if let Some(Token::Integer(text)) = self.token() { |
| 694 | self.consume(); |
| 695 | // Lexer just gives us raw text that looks like an integer. |
| 696 | // Parse it as an Imm64 to check for overflow and other issues. |
| 697 | text.parse().map_err(|e| self.error(e)) |
| 698 | } else { |
| 699 | err!(self.loc, err_msg) |
| 700 | } |
| 701 | } |
| 702 | |
| 703 | // Match and consume a hexadeximal immediate |
| 704 | fn match_hexadecimal_constant(&mut self, err_msg: &str) -> ParseResult<ConstantData> { |
no test coverage detected