mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
Refactor ParseProblem
* Remove the `pos` field, which was always being assigned Position::default() * Remove one use of this `pos`, by removing the never-used SyntaxError::ConditionFailed variant * Adjust the other use to do what was probably intended - which is to say, pointing to the beginning of the def with the error * Rename to FileError, reuse `SourceError` as an inner field, to avoid duplicating the `bytes`
This commit is contained in:
parent
226237d1cd
commit
f22f96843e
9 changed files with 53 additions and 66 deletions
|
@ -16,7 +16,7 @@ use roc_module::symbol::{IdentIds, Interns, ModuleId, ModuleIds};
|
|||
use roc_parse::ident::{parse_ident, Ident};
|
||||
use roc_parse::parser::SyntaxError;
|
||||
use roc_parse::state::State;
|
||||
use roc_region::all::Region;
|
||||
use roc_region::all::{Position, Region};
|
||||
use std::fs;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
|
@ -128,7 +128,7 @@ pub fn syntax_highlight_expr<'a>(
|
|||
|
||||
Ok(buf.to_string())
|
||||
}
|
||||
Err(fail) => Err(SyntaxError::Expr(fail)),
|
||||
Err(fail) => Err(SyntaxError::Expr(fail, Position::default())),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue