mirror of
https://github.com/Zenithsiz/zbuild.git
synced 2026-02-03 14:10:02 +00:00
Replaced manual implementation of at_most with a call to it.
This commit is contained in:
parent
4f898806d2
commit
abf35c9eeb
@ -31,10 +31,7 @@ impl<'a> Ast<'a> {
|
||||
let mut parser = Parser::new(input);
|
||||
let ast = Self::parse_from(&mut parser).with_context(|| {
|
||||
let remaining = parser.remaining();
|
||||
match remaining.len() > 100 {
|
||||
true => format!("Error at:\n'''\n{}[...]\n'''", &remaining[..100]),
|
||||
false => format!("Error at:\n'''\n{remaining}\n'''"),
|
||||
}
|
||||
format!("Error at:\n'''\n{}\n'''", self::at_most(remaining, 100))
|
||||
})?;
|
||||
zutil_app_error::ensure!(parser.is_finished()?, "Unexpected tokens at the end");
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user