Match and consume an Ieee16 immediate.
(&mut self, err_msg: &str)
| 842 | |
| 843 | // Match and consume an Ieee16 immediate. |
| 844 | fn match_ieee16(&mut self, err_msg: &str) -> ParseResult<Ieee16> { |
| 845 | if let Some(Token::Float(text)) = self.token() { |
| 846 | self.consume(); |
| 847 | // Lexer just gives us raw text that looks like a float. |
| 848 | // Parse it as an Ieee16 to check for the right number of digits and other issues. |
| 849 | text.parse().map_err(|e| self.error(e)) |
| 850 | } else { |
| 851 | err!(self.loc, err_msg) |
| 852 | } |
| 853 | } |
| 854 | |
| 855 | // Match and consume an Ieee32 immediate. |
| 856 | fn match_ieee32(&mut self, err_msg: &str) -> ParseResult<Ieee32> { |
no test coverage detected