Parse calls to position(), which has the special form position('string' in 'string').
(&mut self)
| 1140 | |
| 1141 | // Parse calls to position(), which has the special form position('string' in 'string'). |
| 1142 | fn parse_position_expr(&mut self) -> Result<Expr<Raw>, ParserError> { |
| 1143 | self.expect_token(&Token::LParen)?; |
| 1144 | // we must be greater-equal the precedence of IN, which is Like to avoid |
| 1145 | // parsing away the IN as part of the sub expression |
| 1146 | let needle = self.parse_subexpr(Precedence::Like)?; |
| 1147 | self.expect_token(&Token::Keyword(IN))?; |
| 1148 | let haystack = self.parse_expr()?; |
| 1149 | self.expect_token(&Token::RParen)?; |
| 1150 | Ok(Expr::Function(Function { |
| 1151 | name: RawItemName::Name(UnresolvedItemName::unqualified(ident!("position"))), |
| 1152 | args: FunctionArgs::args(vec![needle, haystack]), |
| 1153 | filter: None, |
| 1154 | over: None, |
| 1155 | distinct: false, |
| 1156 | })) |
| 1157 | } |
| 1158 | |
| 1159 | /// Parse calls to normalize(), which can take the form: |
| 1160 | /// - normalize('string') |
no test coverage detected