MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / parse_expr

Function parse_expr

src/expr-parser/src/parser.rs:82–121  ·  view source on GitHub ↗
(ctx: CtxRef, input: ParseStream)

Source from the content-addressed store, hash-verified

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>()?;

Callers 6

try_parse_mirFunction · 0.70
parse_filterFunction · 0.70
parse_top_kFunction · 0.70
parse_operandFunction · 0.70
parse_caseFunction · 0.70
parse_applyFunction · 0.70

Calls 15

parse_constantFunction · 0.85
parse_getFunction · 0.85
parse_let_or_letrec_oldFunction · 0.85
parse_let_or_letrecFunction · 0.85
parse_projectFunction · 0.85
parse_flat_mapFunction · 0.85
parse_filterFunction · 0.85
parse_cross_joinFunction · 0.85
parse_joinFunction · 0.85
parse_distinctFunction · 0.85
parse_reduceFunction · 0.85
parse_top_kFunction · 0.85

Tested by

no test coverage detected