Skip to content

Commit

Permalink
reverse order
Browse files Browse the repository at this point in the history
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
  • Loading branch information
waynexia committed Jul 1, 2024
1 parent e808dbd commit fa3f5de
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/common/function/src/scalars/matches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ impl ParserContext {
);

// conjoin them together
let mut builder = PatternAstBuilder::from_existing(self.stack.remove(0));
for ast in self.stack {
let mut builder = PatternAstBuilder::from_existing(self.stack.pop().unwrap());
while let Some(ast) = self.stack.pop() {
builder.or(ast);
}

Expand Down Expand Up @@ -289,7 +289,7 @@ impl ParserContext {
}
}

for operand in operator_stack.into_iter() {
while let Some(operand) = operator_stack.pop() {
if operand == Token::OpenParen {
return InvalidFuncArgsSnafu {
err_msg: "Unmatched parentheses",
Expand Down Expand Up @@ -695,8 +695,8 @@ mod test {
PatternAst::Binary {
lhs: Box::new(PatternAst::Binary {
lhs: Box::new(PatternAst::Literal {
op: UnaryOp::Negative,
pattern: "c".to_string(),
op: UnaryOp::Optional,
pattern: "a".to_string(),
}),
op: BinaryOp::Or,
rhs: Box::new(PatternAst::Literal {
Expand All @@ -706,8 +706,8 @@ mod test {
}),
op: BinaryOp::Or,
rhs: Box::new(PatternAst::Literal {
op: UnaryOp::Optional,
pattern: "a".to_string(),
op: UnaryOp::Negative,
pattern: "c".to_string(),
}),
},
),
Expand All @@ -716,8 +716,8 @@ mod test {
PatternAst::Binary {
lhs: Box::new(PatternAst::Binary {
lhs: Box::new(PatternAst::Literal {
op: UnaryOp::Optional,
pattern: "c".to_string(),
op: UnaryOp::Must,
pattern: "a".to_string(),
}),
op: BinaryOp::Or,
rhs: Box::new(PatternAst::Literal {
Expand All @@ -727,8 +727,8 @@ mod test {
}),
op: BinaryOp::Or,
rhs: Box::new(PatternAst::Literal {
op: UnaryOp::Must,
pattern: "a".to_string(),
op: UnaryOp::Optional,
pattern: "c".to_string(),
}),
},
),
Expand Down

0 comments on commit fa3f5de

Please sign in to comment.