From bd5778fa248a65050a34f05a4e9a8fe403a74c12 Mon Sep 17 00:00:00 2001 From: JT <547158+jntrnr@users.noreply.github.com> Date: Sun, 20 Mar 2022 08:12:10 +1300 Subject: [PATCH] remove the boolean vars (#4879) --- .../tests/format_conversions/nuon.rs | 2 +- crates/nu-parser/src/parser.rs | 22 +------------------ src/tests/test_engine.rs | 10 --------- 3 files changed, 2 insertions(+), 32 deletions(-) diff --git a/crates/nu-command/tests/format_conversions/nuon.rs b/crates/nu-command/tests/format_conversions/nuon.rs index eaba7614f0..37dcce7a4c 100644 --- a/crates/nu-command/tests/format_conversions/nuon.rs +++ b/crates/nu-command/tests/format_conversions/nuon.rs @@ -156,7 +156,7 @@ fn read_bool() { let actual = nu!( cwd: "tests/fixtures/formats", pipeline( r#" - open sample.nuon | get 3 | $in == $true + open sample.nuon | get 3 | $in == true "# )); diff --git a/crates/nu-parser/src/parser.rs b/crates/nu-parser/src/parser.rs index bcb3031f64..d63fb6f9c2 100644 --- a/crates/nu-parser/src/parser.rs +++ b/crates/nu-parser/src/parser.rs @@ -1590,27 +1590,7 @@ pub fn parse_variable_expr( ) -> (Expression, Option) { let contents = working_set.get_span_contents(span); - if contents == b"$true" { - return ( - Expression { - expr: Expr::Bool(true), - span, - ty: Type::Bool, - custom_completion: None, - }, - None, - ); - } else if contents == b"$false" { - return ( - Expression { - expr: Expr::Bool(false), - span, - ty: Type::Bool, - custom_completion: None, - }, - None, - ); - } else if contents == b"$nothing" { + if contents == b"$nothing" { return ( Expression { expr: Expr::Nothing, diff --git a/src/tests/test_engine.rs b/src/tests/test_engine.rs index db9ca46bd8..8834d8e33b 100644 --- a/src/tests/test_engine.rs +++ b/src/tests/test_engine.rs @@ -278,16 +278,6 @@ fn open_ended_range() -> TestResult { run_test(r#"1.. | first 100000 | length"#, "100000") } -#[test] -fn bool_variable() -> TestResult { - run_test(r#"$true"#, "true") -} - -#[test] -fn bool_variable2() -> TestResult { - run_test(r#"$false"#, "false") -} - #[test] fn default_value1() -> TestResult { run_test(r#"def foo [x = 3] { $x }; foo"#, "3")