Bugfix: Fix MATH::SQRT_2 not parsing (#3514)
This commit is contained in:
parent
485a224bcd
commit
6469b653cd
1 changed files with 10 additions and 1 deletions
|
@ -269,6 +269,7 @@ pub(crate) fn builtin_name(i: &str) -> IResult<&str, BuiltinName<&str>, ParseErr
|
|||
product => { fn },
|
||||
round => { fn },
|
||||
spread => { fn },
|
||||
SQRT_2 => { const = constant::Constant::MathSqrt2 },
|
||||
sqrt => { fn },
|
||||
stddev => { fn },
|
||||
sum => { fn },
|
||||
|
@ -293,7 +294,6 @@ pub(crate) fn builtin_name(i: &str) -> IResult<&str, BuiltinName<&str>, ParseErr
|
|||
LOG2_10 => { const = constant::Constant::MathLog210 },
|
||||
LOG2_E => { const = constant::Constant::MathLog2E },
|
||||
PI => { const = constant::Constant::MathPi },
|
||||
SQRT_2 => { const = constant::Constant::MathSqrt2 },
|
||||
TAU => { const = constant::Constant::MathTau },
|
||||
},
|
||||
meta => {
|
||||
|
@ -548,4 +548,13 @@ mod tests {
|
|||
let out = res.unwrap().1;
|
||||
assert_eq!(out, BuiltinName::Constant(Constant::MathPi));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn constant_sqrt_2() {
|
||||
let sql = "math::SqRt_2";
|
||||
let res = builtin_name(sql);
|
||||
assert!(res.is_ok());
|
||||
let out = res.unwrap().1;
|
||||
assert_eq!(out, BuiltinName::Constant(Constant::MathSqrt2));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue