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,
|
None,
|
||||||
)
|
)
|
||||||
} else {
|
} 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
|
// this seems okay to set it to unknown here, but we should double-check
|
||||||
let id = working_set.add_variable(name, Type::Unknown);
|
//let id = working_set.add_variable(name, Type::Unknown);
|
||||||
(
|
// (
|
||||||
Expression {
|
// Expression {
|
||||||
expr: Expr::Var(id),
|
// expr: Expr::Var(id),
|
||||||
span,
|
// span,
|
||||||
ty: Type::Unknown,
|
// ty: Type::Unknown,
|
||||||
},
|
// },
|
||||||
None,
|
// None,
|
||||||
)
|
// )
|
||||||
|
// } else {
|
||||||
|
(garbage(span), err)
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
(garbage(span), err)
|
(garbage(span), err)
|
||||||
@ -1995,6 +1998,7 @@ pub fn parse_block_expression(
|
|||||||
output.signature = signature;
|
output.signature = signature;
|
||||||
} else if let Some(last) = working_set.delta.scope.last() {
|
} 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.
|
// 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") {
|
if let Some(var_id) = last.get_var(b"$it") {
|
||||||
let mut signature = Signature::new("");
|
let mut signature = Signature::new("");
|
||||||
signature.required_positional.push(PositionalArg {
|
signature.required_positional.push(PositionalArg {
|
||||||
|
@ -34,7 +34,7 @@ pub enum SyntaxShape {
|
|||||||
GlobPattern,
|
GlobPattern,
|
||||||
|
|
||||||
/// A block is allowed, eg `{start this thing}`
|
/// A block is allowed, eg `{start this thing}`
|
||||||
Block,
|
Block(Vec<(Vec<u8>, SyntaxShape)>),
|
||||||
|
|
||||||
/// A table is allowed, eg `[[first, second]; [1, 2]]`
|
/// A table is allowed, eg `[[first, second]; [1, 2]]`
|
||||||
Table,
|
Table,
|
||||||
|
Loading…
Reference in New Issue
Block a user