Parse a literal expression.
(expr: Expr, unsupported: fn(Expr) -> SqlUnsupported)
| 295 | |
| 296 | /// Parse a literal expression. |
| 297 | pub(crate) fn parse_literal_expr(expr: Expr, unsupported: fn(Expr) -> SqlUnsupported) -> SqlParseResult<SqlLiteral> { |
| 298 | match expr { |
| 299 | Expr::Value(value) => parse_literal(value), |
| 300 | Expr::UnaryOp { |
| 301 | op: UnaryOperator::Plus, |
| 302 | expr, |
| 303 | } => parse_signed_literal_expr(UnaryOperator::Plus, *expr, unsupported), |
| 304 | Expr::UnaryOp { |
| 305 | op: UnaryOperator::Minus, |
| 306 | expr, |
| 307 | } => parse_signed_literal_expr(UnaryOperator::Minus, *expr, unsupported), |
| 308 | expr => Err(unsupported(expr).into()), |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | /// Parse an optional scalar expression |
| 313 | pub(crate) fn parse_expr_opt(opt: Option<Expr>) -> SqlParseResult<Option<SqlExpr>> { |
no test coverage detected
searching dependent graphs…