Match and consume an enumerated immediate, like one of the condition codes.
(&mut self, err_msg: &str)
| 890 | |
| 891 | // Match and consume an enumerated immediate, like one of the condition codes. |
| 892 | fn match_enum<T: FromStr>(&mut self, err_msg: &str) -> ParseResult<T> { |
| 893 | if let Some(Token::Identifier(text)) = self.token() { |
| 894 | self.consume(); |
| 895 | text.parse().map_err(|_| self.error(err_msg)) |
| 896 | } else { |
| 897 | err!(self.loc, err_msg) |
| 898 | } |
| 899 | } |
| 900 | |
| 901 | // Match and a consume a possibly empty sequence of memory operation flags. |
| 902 | fn optional_memflags(&mut self) -> ParseResult<MemFlagsData> { |
no test coverage detected