From adb92b970e3ddf6975f735f04d8898a874ff06dd Mon Sep 17 00:00:00 2001 From: Tanishq Kancharla Date: Fri, 1 Oct 2021 22:07:17 -0400 Subject: [PATCH] nothing --- crates/nu-parser/src/parser.rs | 19 ++++++++----------- example.nu | 1 + 2 files changed, 9 insertions(+), 11 deletions(-) create mode 100644 example.nu diff --git a/crates/nu-parser/src/parser.rs b/crates/nu-parser/src/parser.rs index 38b5123763..76e5c88037 100644 --- a/crates/nu-parser/src/parser.rs +++ b/crates/nu-parser/src/parser.rs @@ -2507,24 +2507,21 @@ pub fn parse_source( let contents = std::fs::read(path); if let Ok(contents) = contents { + // This will load the defs from the file into the + // working set, if it was a successful parse. let (block, err) = parse( working_set, path.file_name().and_then(|x| x.to_str()), &contents, - true, + false, ); - if let None = err { - // Successful parse - // What should I be doing here? - let block_id = working_set.add_block(block); + if let Some(_) = err { + // Unsuccessful parse of file // return ( - // // Successful parse - // // Why creating a pipeline here for only one expression? - // // Is there a way to only make this a declaration? // Statement::Pipeline(Pipeline::from_vec(vec![Expression { - // expr: Expr::Subexpression(block_id), - // span: span(spans), - // ty: Type::Unknown, // FIXME + // expr: Expr::Call(call), + // span: call_span, + // ty: Type::Unknown, // }])), // None, // ); diff --git a/example.nu b/example.nu new file mode 100644 index 0000000000..75138d409f --- /dev/null +++ b/example.nu @@ -0,0 +1 @@ +alias x = 4 \ No newline at end of file