the design is very human
This commit is contained in:
parent
b72f0afe84
commit
e25a89d56d
|
@ -21,14 +21,20 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||||
hbasm::text::ErrorKind::UnexpectedEnd => 3,
|
hbasm::text::ErrorKind::UnexpectedEnd => 3,
|
||||||
hbasm::text::ErrorKind::InvalidSymbol => 4,
|
hbasm::text::ErrorKind::InvalidSymbol => 4,
|
||||||
};
|
};
|
||||||
|
let message = match e.kind {
|
||||||
|
hbasm::text::ErrorKind::UnexpectedToken => "This token is not expected!",
|
||||||
|
hbasm::text::ErrorKind::InvalidToken => "The token is not valid!",
|
||||||
|
hbasm::text::ErrorKind::UnexpectedEnd => "The assembler reached the end of input unexpectedly!",
|
||||||
|
hbasm::text::ErrorKind::InvalidSymbol => "This referenced symbol doesn't have a corresponding label!",
|
||||||
|
};
|
||||||
let a = colors.next();
|
let a = colors.next();
|
||||||
|
|
||||||
Report::build(ReportKind::Error, "engine_internal", 12)
|
Report::build(ReportKind::Error, "engine_internal", e.span.clone().start)
|
||||||
.with_code(e_code)
|
.with_code(e_code)
|
||||||
.with_message(format!("{:?}", e.kind))
|
.with_message(format!("{:?}", e.kind))
|
||||||
.with_label(
|
.with_label(
|
||||||
Label::new(("engine_internal", e.span.clone()))
|
Label::new(("engine_internal", e.span.clone()))
|
||||||
.with_message(format!("{:?}", e.kind))
|
.with_message(message)
|
||||||
.with_color(a),
|
.with_color(a),
|
||||||
)
|
)
|
||||||
.finish()
|
.finish()
|
||||||
|
|
Loading…
Reference in a new issue