mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
refactor parser: rename method pub fn block to parse_block (#3047)
* refactor parser: rename method block to parse_block * nu-cli/src/completion/engine.rs block to parse_block
This commit is contained in:
@ -410,7 +410,7 @@ mod tests {
|
||||
#[quickcheck]
|
||||
fn quickcheck_parse(data: String) -> bool {
|
||||
let (tokens, err) = nu_parser::lex(&data, 0);
|
||||
let (lite_block, err2) = nu_parser::block(tokens);
|
||||
let (lite_block, err2) = nu_parser::parse_block(tokens);
|
||||
if err.is_none() && err2.is_none() {
|
||||
let context = basic_evaluation_context().unwrap();
|
||||
let _ = nu_parser::classify_block(&lite_block, &context.scope);
|
||||
|
@ -256,7 +256,7 @@ pub fn completion_location(line: &str, block: &Block, pos: usize) -> Vec<Complet
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
use nu_parser::{block, classify_block, lex, ParserScope};
|
||||
use nu_parser::{classify_block, lex, parse_block, ParserScope};
|
||||
use nu_protocol::{Signature, SyntaxShape};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
@ -307,7 +307,7 @@ mod tests {
|
||||
pos: usize,
|
||||
) -> Vec<LocationType> {
|
||||
let (tokens, _) = lex(line, 0);
|
||||
let (lite_block, _) = block(tokens);
|
||||
let (lite_block, _) = parse_block(tokens);
|
||||
|
||||
scope.enter_scope();
|
||||
let (block, _) = classify_block(&lite_block, scope);
|
||||
|
@ -119,7 +119,7 @@ impl rustyline::validate::Validator for NuValidator {
|
||||
}
|
||||
}
|
||||
|
||||
let (_, err) = nu_parser::block(tokens);
|
||||
let (_, err) = nu_parser::parse_block(tokens);
|
||||
|
||||
if let Some(err) = err {
|
||||
if let nu_errors::ParseErrorReason::Eof { .. } = err.reason() {
|
||||
|
Reference in New Issue
Block a user