mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-15 17:15:24 +00:00
Integrate ParseError to compiler-core::Error
This commit is contained in:
parent
9d6ab72d79
commit
9d67b944cf
6 changed files with 69 additions and 32 deletions
|
@ -2,6 +2,7 @@ use rustpython_codegen::{compile, symboltable};
|
|||
use rustpython_compiler_core::CodeObject;
|
||||
use rustpython_parser::{
|
||||
ast::{fold::Fold, ConstantOptimizer, Location},
|
||||
error::ParseErrorType,
|
||||
parser,
|
||||
};
|
||||
use std::fmt;
|
||||
|
@ -48,6 +49,7 @@ impl CompileError {
|
|||
}
|
||||
}
|
||||
fn from_parse(error: rustpython_parser::error::ParseError, source: &str) -> Self {
|
||||
let error: rustpython_compiler_core::Error<ParseErrorType> = error.into();
|
||||
Self {
|
||||
error: error.error.into(),
|
||||
location: error.location,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue