mirror of
https://github.com/nushell/nushell
synced 2024-12-27 13:33:16 +00:00
This reverts commit c023d4111a
.
This commit is contained in:
parent
6e65aef9bf
commit
54d9fff4f2
4 changed files with 4 additions and 30 deletions
|
@ -1,13 +0,0 @@
|
||||||
use nu_test_support::{nu, pipeline};
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn echo_range_is_lazy() {
|
|
||||||
let actual = nu!(
|
|
||||||
cwd: "tests/fixtures/formats", pipeline(
|
|
||||||
r#"
|
|
||||||
alias bar = source sample_def.nu; bar; greet
|
|
||||||
"#
|
|
||||||
));
|
|
||||||
|
|
||||||
assert_eq!(actual.out, "hello");
|
|
||||||
}
|
|
|
@ -1,4 +1,3 @@
|
||||||
mod alias;
|
|
||||||
mod all;
|
mod all;
|
||||||
mod any;
|
mod any;
|
||||||
mod append;
|
mod append;
|
||||||
|
|
|
@ -897,19 +897,10 @@ pub fn parse_call(
|
||||||
new_spans.extend(&spans[(pos + 1)..]);
|
new_spans.extend(&spans[(pos + 1)..]);
|
||||||
}
|
}
|
||||||
|
|
||||||
let alias_id = working_set.hide_alias(&name);
|
working_set.enter_scope();
|
||||||
let lite_command = LiteCommand {
|
working_set.hide_alias(&name);
|
||||||
comments: vec![],
|
let (mut result, err) = parse_expression(working_set, &new_spans, false);
|
||||||
parts: new_spans.clone(),
|
working_set.exit_scope();
|
||||||
};
|
|
||||||
let (mut result, err) = parse_builtin_commands(working_set, &lite_command);
|
|
||||||
if let Some(frame) = working_set.delta.scope.last_mut() {
|
|
||||||
if let Some(alias_id) = alias_id {
|
|
||||||
frame.aliases.insert(name.clone(), alias_id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut result = result.expressions.remove(0);
|
|
||||||
|
|
||||||
result.replace_span(working_set, expansion_span, orig_span);
|
result.replace_span(working_set, expansion_span, orig_span);
|
||||||
|
|
||||||
|
|
3
tests/fixtures/formats/sample_def.nu
vendored
3
tests/fixtures/formats/sample_def.nu
vendored
|
@ -1,3 +0,0 @@
|
||||||
def greet [] {
|
|
||||||
"hello"
|
|
||||||
}
|
|
Loading…
Reference in a new issue