Parse one or more privileges separated by a ','.
(&mut self)
| 10093 | |
| 10094 | /// Parse one or more privileges separated by a ','. |
| 10095 | fn parse_privilege_specification(&mut self) -> Option<PrivilegeSpecification> { |
| 10096 | if self.parse_keyword(ALL) { |
| 10097 | let _ = self.parse_keyword(PRIVILEGES); |
| 10098 | return Some(PrivilegeSpecification::All); |
| 10099 | } |
| 10100 | |
| 10101 | let mut privileges = Vec::new(); |
| 10102 | while let Some(privilege) = self.parse_privilege() { |
| 10103 | privileges.push(privilege); |
| 10104 | if !self.consume_token(&Token::Comma) { |
| 10105 | break; |
| 10106 | } |
| 10107 | } |
| 10108 | |
| 10109 | if privileges.is_empty() { |
| 10110 | None |
| 10111 | } else { |
| 10112 | Some(PrivilegeSpecification::Privileges(privileges)) |
| 10113 | } |
| 10114 | } |
| 10115 | |
| 10116 | /// Bail out if the current token is not a role specification, or consume and return it if it is. |
| 10117 | fn expect_role_specification(&mut self) -> Result<Ident, ParserError> { |
no test coverage detected