Skip to content

Commit

Permalink
implement parser for Conditional operator, priority: imp < cond < or
Browse files Browse the repository at this point in the history
  • Loading branch information
zao111222333 committed Apr 2, 2024
1 parent 827fa14 commit 6c8481b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/boolean_expression/_impl_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,10 @@ fn cond(data: &[ExprToken]) -> Result<Box<BooleanExpression>, String> {
or(&data[..question_token])?,or(&data[(question_token+1)..colon_token])?,or(&data[(colon_token + 1)..])?
))),
(None, Some(_)) => Err(format!(
"Expected variable name or (...), but found {:?}.",
data
"Expected `?` but only found `:`."
)),
(Some(_), None) => Err(format!(
"Expected variable name or (...), but found {:?}.",
data
"Expected `:` but only found `?`."
)),
}
}
Expand Down

0 comments on commit 6c8481b

Please sign in to comment.