mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 04:19:18 +00:00
Move token and error structs into related modules (#11957)
## Summary This PR does some housekeeping into moving certain structs into related modules. Specifically, 1. Move `LexicalError` from `lexer.rs` to `error.rs` which also contains the `ParseError` 2. Move `Token`, `TokenFlags` and `TokenValue` from `lexer.rs` to `token.rs`
This commit is contained in:
parent
4667d8697c
commit
96da136e6a
10 changed files with 352 additions and 342 deletions
|
@ -5,7 +5,7 @@ use bstr::ByteSlice;
|
|||
use ruff_python_ast::{self as ast, AnyStringFlags, Expr, StringFlags};
|
||||
use ruff_text_size::{Ranged, TextRange, TextSize};
|
||||
|
||||
use crate::lexer::{LexicalError, LexicalErrorType};
|
||||
use crate::error::{LexicalError, LexicalErrorType};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) enum StringType {
|
||||
|
@ -471,7 +471,7 @@ pub(crate) fn parse_fstring_literal_element(
|
|||
mod tests {
|
||||
use ruff_python_ast::Suite;
|
||||
|
||||
use crate::lexer::LexicalErrorType;
|
||||
use crate::error::LexicalErrorType;
|
||||
use crate::{parse_module, FStringErrorType, ParseError, ParseErrorType, Parsed};
|
||||
|
||||
const WINDOWS_EOL: &str = "\r\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue