codegen::{CompileError -> CodegenError}

This commit is contained in:
Jeong YunWon 2022-08-22 06:30:06 +09:00
parent 3690272256
commit cf10e800a6
4 changed files with 72 additions and 71 deletions

View file

@ -8,7 +8,7 @@ Inspirational file: https://github.com/python/cpython/blob/main/Python/symtable.
*/
use crate::{
error::{CompileError, CompileErrorType},
error::{CodegenError, CodegenErrorType},
IndexMap,
};
use rustpython_ast::{self as ast, Location};
@ -168,9 +168,9 @@ pub struct SymbolTableError {
}
impl SymbolTableError {
pub fn into_compile_error(self, source_path: String) -> CompileError {
CompileError {
error: CompileErrorType::SyntaxError(self.error),
pub fn into_codegen_error(self, source_path: String) -> CodegenError {
CodegenError {
error: CodegenErrorType::SyntaxError(self.error),
location: self.location,
source_path,
}