Skip to content

Commit 1511b66

Browse files
committed
Break down rustpython_parser::error module
because it doesn't share any common errors but specific error for each sub module
1 parent 2a8aa6f commit 1511b66

File tree

7 files changed

+338
-345
lines changed

7 files changed

+338
-345
lines changed

parser/python.lalrpop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
use crate::{
77
ast,
8-
error::{LexicalError, LexicalErrorType},
8+
lexer::{LexicalError, LexicalErrorType},
99
function::{ArgumentList, parse_args, parse_params, validate_arguments},
1010
lexer,
1111
context::set_context,

parser/src/error.rs

Lines changed: 0 additions & 331 deletions
This file was deleted.

parser/src/function.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Contains functions that perform validation and parsing of arguments and parameters.
22
// Checks apply both to functions and to lambdas.
33
use crate::ast;
4-
use crate::error::{LexicalError, LexicalErrorType};
4+
use crate::lexer::{LexicalError, LexicalErrorType};
55
use rustc_hash::FxHashSet;
66

77
pub(crate) struct ArgumentList {
@@ -149,8 +149,8 @@ fn is_starred(exp: &ast::Expr) -> bool {
149149

150150
#[cfg(test)]
151151
mod tests {
152-
use crate::error::{LexicalErrorType, ParseErrorType};
153-
use crate::parser::parse_program;
152+
use crate::lexer::LexicalErrorType;
153+
use crate::parser::{parse_program, ParseErrorType};
154154

155155
macro_rules! function_and_lambda {
156156
($($name:ident: $code:expr,)*) => {

0 commit comments

Comments
 (0)