mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 09:25:38 +02:00
Add support for magic open
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
use crate::parser::ast;
|
||||
use crate::prelude::*;
|
||||
use crate::object::Primitive;
|
||||
use derive_new::new;
|
||||
|
||||
#[derive(new)]
|
||||
@ -20,10 +21,7 @@ crate fn evaluate_expr(expr: &ast::Expression, scope: &Scope) -> Result<Value, S
|
||||
match expr {
|
||||
Expression::Leaf(l) => Ok(evaluate_leaf(l)),
|
||||
Expression::Parenthesized(p) => evaluate_expr(&p.expr, scope),
|
||||
Expression::Flag(f) => Err(ShellError::string(format!(
|
||||
"can't evaluate the flag {}",
|
||||
f.print()
|
||||
))),
|
||||
Expression::Flag(f) => Ok(Value::Primitive(Primitive::String(f.print()))),
|
||||
Expression::Block(b) => evaluate_block(&b, scope),
|
||||
Expression::Path(p) => evaluate_path(&p, scope),
|
||||
Expression::Binary(b) => evaluate_binary(b, scope),
|
||||
|
Reference in New Issue
Block a user