diff --git a/crates/nu-parser/src/parser.rs b/crates/nu-parser/src/parser.rs index a251683362..49280dacc6 100644 --- a/crates/nu-parser/src/parser.rs +++ b/crates/nu-parser/src/parser.rs @@ -4040,7 +4040,6 @@ pub fn parse_operator( b">" => Operator::GreaterThan, b">=" => Operator::GreaterThanOrEqual, b"=~" => Operator::RegexMatch, - b"=^" => Operator::StartsWith, b"!~" => Operator::NotRegexMatch, b"+" => Operator::Plus, b"-" => Operator::Minus, @@ -4049,6 +4048,7 @@ pub fn parse_operator( b"in" => Operator::In, b"not-in" => Operator::NotIn, b"mod" => Operator::Modulo, + b"starts-with" => Operator::StartsWith, b"&&" | b"and" => Operator::And, b"||" | b"or" => Operator::Or, b"**" => Operator::Pow, diff --git a/crates/nu-protocol/src/ast/operator.rs b/crates/nu-protocol/src/ast/operator.rs index 9e18683ab3..72a6d0f82e 100644 --- a/crates/nu-protocol/src/ast/operator.rs +++ b/crates/nu-protocol/src/ast/operator.rs @@ -47,7 +47,7 @@ impl Display for Operator { Operator::Pow => write!(f, "**"), Operator::LessThanOrEqual => write!(f, "<="), Operator::GreaterThanOrEqual => write!(f, ">="), - Operator::StartsWith => write!(f, "=^"), + Operator::StartsWith => write!(f, "starts-with"), } } } diff --git a/src/tests/test_parser.rs b/src/tests/test_parser.rs index a956950b6c..56481704b2 100644 --- a/src/tests/test_parser.rs +++ b/src/tests/test_parser.rs @@ -321,7 +321,7 @@ fn capture_row_condition() -> TestResult { #[test] fn starts_with_operator_succeeds() -> TestResult { run_test( - r#"[Moe Larry Curly] | where $it =^ L | str collect"#, + r#"[Moe Larry Curly] | where $it starts-with L | str collect"#, "Larry", ) }