(ctx: CtxRef, input: ParseStream)
| 80 | type Result = syn::Result<MirRelationExpr>; |
| 81 | |
| 82 | pub fn parse_expr(ctx: CtxRef, input: ParseStream) -> Result { |
| 83 | let lookahead = input.lookahead1(); |
| 84 | if lookahead.peek(kw::Constant) { |
| 85 | parse_constant(ctx, input) |
| 86 | } else if lookahead.peek(kw::Get) { |
| 87 | parse_get(ctx, input) |
| 88 | } else if lookahead.peek(kw::Return) { |
| 89 | parse_let_or_letrec_old(ctx, input) |
| 90 | } else if lookahead.peek(kw::With) { |
| 91 | parse_let_or_letrec(ctx, input) |
| 92 | } else if lookahead.peek(kw::Project) { |
| 93 | parse_project(ctx, input) |
| 94 | } else if lookahead.peek(kw::Map) { |
| 95 | parse_map(ctx, input) |
| 96 | } else if lookahead.peek(kw::FlatMap) { |
| 97 | parse_flat_map(ctx, input) |
| 98 | } else if lookahead.peek(kw::Filter) { |
| 99 | parse_filter(ctx, input) |
| 100 | } else if lookahead.peek(kw::CrossJoin) { |
| 101 | parse_cross_join(ctx, input) |
| 102 | } else if lookahead.peek(kw::Join) { |
| 103 | parse_join(ctx, input) |
| 104 | } else if lookahead.peek(kw::Distinct) { |
| 105 | parse_distinct(ctx, input) |
| 106 | } else if lookahead.peek(kw::Reduce) { |
| 107 | parse_reduce(ctx, input) |
| 108 | } else if lookahead.peek(kw::TopK) { |
| 109 | parse_top_k(ctx, input) |
| 110 | } else if lookahead.peek(kw::Negate) { |
| 111 | parse_negate(ctx, input) |
| 112 | } else if lookahead.peek(kw::Threshold) { |
| 113 | parse_threshold(ctx, input) |
| 114 | } else if lookahead.peek(kw::Union) { |
| 115 | parse_union(ctx, input) |
| 116 | } else if lookahead.peek(kw::ArrangeBy) { |
| 117 | parse_arrange_by(ctx, input) |
| 118 | } else { |
| 119 | Err(lookahead.error()) |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | fn parse_constant(ctx: CtxRef, input: ParseStream) -> Result { |
| 124 | let constant = input.parse::<kw::Constant>()?; |
no test coverage detected