Match and consume an Ieee32 immediate.
(&mut self, err_msg: &str)
| 854 | |
| 855 | // Match and consume an Ieee32 immediate. |
| 856 | fn match_ieee32(&mut self, err_msg: &str) -> ParseResult<Ieee32> { |
| 857 | if let Some(Token::Float(text)) = self.token() { |
| 858 | self.consume(); |
| 859 | // Lexer just gives us raw text that looks like a float. |
| 860 | // Parse it as an Ieee32 to check for the right number of digits and other issues. |
| 861 | text.parse().map_err(|e| self.error(e)) |
| 862 | } else { |
| 863 | err!(self.loc, err_msg) |
| 864 | } |
| 865 | } |
| 866 | |
| 867 | // Match and consume an Ieee64 immediate. |
| 868 | fn match_ieee64(&mut self, err_msg: &str) -> ParseResult<Ieee64> { |
no test coverage detected