From 02953b9fe67f69a80da060a6335d0cb4055fcc10 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 17 Oct 2022 11:59:22 -0400 Subject: [PATCH] Remove parse_program_tokens --- parser/src/parser.rs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/parser/src/parser.rs b/parser/src/parser.rs index 9531eb3..90903cf 100644 --- a/parser/src/parser.rs +++ b/parser/src/parser.rs @@ -5,11 +5,10 @@ //! parse a whole program, a single statement, or a single //! expression. -use std::iter; - use crate::lexer::LexResult; pub use crate::mode::Mode; use crate::{ast, error::ParseError, lexer, python}; +use std::iter; /* * Parse python code. @@ -25,17 +24,6 @@ pub fn parse_program(source: &str, source_path: &str) -> Result, - source_path: &str, -) -> Result { - parse_tokens(lxr, Mode::Module, source_path).map(|top| match top { - ast::Mod::Module { body, .. } => body, - _ => unreachable!(), - }) -} - /// Parses a python expression /// /// # Example @@ -95,7 +83,7 @@ pub fn parse(source: &str, mode: Mode, source_path: &str) -> Result, + lxr: impl IntoIterator, mode: Mode, source_path: &str, ) -> Result {