Add record literal syntax (#326)

This commit is contained in:
JT
2021-11-11 12:14:00 +13:00
committed by GitHub
parent 586c6d9fa8
commit 568e566adf
9 changed files with 160 additions and 4 deletions

View File

@ -33,9 +33,9 @@ impl Command for Do {
call: &Call,
input: PipelineData,
) -> Result<nu_protocol::PipelineData, nu_protocol::ShellError> {
let block_id = call.positional[0]
.as_block()
.expect("internal error: expected block");
let block: Value = call.req(engine_state, stack, 0)?;
let block_id = block.as_block()?;
let rest: Vec<Value> = call.rest(engine_state, stack, 1)?;
let block = engine_state.get_block(block_id);