Remove old alias implementation (#8797)

This commit is contained in:
Jakub Žádník
2023-04-07 21:09:38 +03:00
committed by GitHub
parent d881481758
commit 1b677f167e
39 changed files with 387 additions and 1818 deletions

View File

@ -64,13 +64,7 @@ pub(crate) fn parse_commandline_args(
let mut working_set = StateWorkingSet::new(engine_state);
working_set.add_decl(Box::new(Nu));
let output = parse(
&mut working_set,
None,
commandline_args.as_bytes(),
false,
&[],
);
let output = parse(&mut working_set, None, commandline_args.as_bytes(), false);
if let Some(err) = working_set.parse_errors.first() {
report_error(&working_set, err);

View File

@ -22,7 +22,7 @@ fn find_id(
location: &Value,
) -> Option<(Id, usize, Span)> {
let offset = working_set.next_span_start();
let block = parse(working_set, Some(file_path), file, false, &[]);
let block = parse(working_set, Some(file_path), file, false);
let flattened = flatten_block(working_set, &block);
@ -78,7 +78,7 @@ pub fn check(engine_state: &mut EngineState, file_path: &String) {
if let Ok(contents) = file {
let offset = working_set.next_span_start();
let block = parse(&mut working_set, Some(file_path), &contents, false, &[]);
let block = parse(&mut working_set, Some(file_path), &contents, false);
for err in &working_set.parse_errors {
let mut span = err.span();

View File

@ -62,18 +62,14 @@ fn load_standard_library(
working_set.add_file(name.clone(), content);
let end = working_set.next_span_start();
let (_, module, comments) = parse_module_block(
&mut working_set,
Span::new(start, end),
name.as_bytes(),
&[],
);
let (_, module, comments) =
parse_module_block(&mut working_set, Span::new(start, end), name.as_bytes());
if let Some(err) = working_set.parse_errors.first() {
report_error(&working_set, err);
}
parse(&mut working_set, Some(&name), content, true, &[]);
parse(&mut working_set, Some(&name), content, true);
if let Some(err) = working_set.parse_errors.first() {
report_error(&working_set, err);

View File

@ -229,7 +229,6 @@ pub fn nu_repl() {
Some(&format!("line{i}")),
line.as_bytes(),
false,
&[],
);
if let Some(err) = working_set.parse_errors.first() {