mirror of
https://github.com/nushell/nushell.git
synced 2024-12-22 23:23:12 +01:00
WIP
This commit is contained in:
parent
648fe052db
commit
eb67eab122
@ -1030,17 +1030,20 @@ pub fn parse_variable_expr(
|
||||
None,
|
||||
)
|
||||
} else {
|
||||
let name = working_set.get_span_contents(span).to_vec();
|
||||
// let name = working_set.get_span_contents(span).to_vec();
|
||||
// this seems okay to set it to unknown here, but we should double-check
|
||||
let id = working_set.add_variable(name, Type::Unknown);
|
||||
(
|
||||
Expression {
|
||||
expr: Expr::Var(id),
|
||||
span,
|
||||
ty: Type::Unknown,
|
||||
},
|
||||
None,
|
||||
)
|
||||
//let id = working_set.add_variable(name, Type::Unknown);
|
||||
// (
|
||||
// Expression {
|
||||
// expr: Expr::Var(id),
|
||||
// span,
|
||||
// ty: Type::Unknown,
|
||||
// },
|
||||
// None,
|
||||
// )
|
||||
// } else {
|
||||
(garbage(span), err)
|
||||
// }
|
||||
}
|
||||
} else {
|
||||
(garbage(span), err)
|
||||
@ -1995,6 +1998,7 @@ pub fn parse_block_expression(
|
||||
output.signature = signature;
|
||||
} else if let Some(last) = working_set.delta.scope.last() {
|
||||
// FIXME: this only supports the top $it. Instead, we should look for a free $it in the expression.
|
||||
|
||||
if let Some(var_id) = last.get_var(b"$it") {
|
||||
let mut signature = Signature::new("");
|
||||
signature.required_positional.push(PositionalArg {
|
||||
|
@ -34,7 +34,7 @@ pub enum SyntaxShape {
|
||||
GlobPattern,
|
||||
|
||||
/// A block is allowed, eg `{start this thing}`
|
||||
Block,
|
||||
Block(Vec<(Vec<u8>, SyntaxShape)>),
|
||||
|
||||
/// A table is allowed, eg `[[first, second]; [1, 2]]`
|
||||
Table,
|
||||
|
Loading…
Reference in New Issue
Block a user