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:
Michael Angerman
2021-02-12 12:31:11 -08:00
committed by GitHub
parent 617341f8d5
commit 011b7c4a07
9 changed files with 25 additions and 25 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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() {