mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-19 11:05:45 +00:00
Use muiltipeek
This commit is contained in:
parent
8649bf6f8f
commit
f1f31324d0
2 changed files with 94 additions and 85 deletions
|
@ -14,11 +14,11 @@
|
|||
|
||||
use crate::lexer::{LexResult, Tok};
|
||||
pub use crate::mode::Mode;
|
||||
use crate::soft_keywords::SoftKeywordTransformer;
|
||||
use crate::{ast, error::ParseError, lexer, python};
|
||||
use ast::Location;
|
||||
use itertools::Itertools;
|
||||
use std::iter;
|
||||
use crate::soft_keywords::soft_keywords;
|
||||
|
||||
/// Parse a full Python program usually consisting of multiple lines.
|
||||
///
|
||||
|
@ -190,7 +190,7 @@ pub fn parse_tokens(
|
|||
.chain(lxr)
|
||||
.filter_ok(|(_, tok, _)| !matches!(tok, Tok::Comment { .. } | Tok::NonLogicalNewline));
|
||||
python::TopParser::new()
|
||||
.parse(soft_keywords(tokenizer, mode).into_iter())
|
||||
.parse(SoftKeywordTransformer::new(tokenizer, mode).into_iter())
|
||||
.map_err(|e| crate::error::parse_error_from_lalrpop(e, source_path))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue