Open lkolbly opened 2 years ago
Currently, parse errors give fairly cryptic messages. For example, this:
module blinky() -> (bit led) { led = led[t-1]; }
throws an error like:
thread 'main' panicked at 'Parse failed!: Error { variant: ParsingError { positives: [variable_type, indexed_variable], negatives: [] }, location: Pos(183), line_col: Pos((9, 5)), path: None, line: " led = ~led[t-1];␊", continued_line: None }', src/parse.rs:29:10 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
which is difficult for the user to read. Ideally, we would say something like "at this location, expected a X or a Y."
Additionally, we should try using e.g. this crate: https://github.com/zesterer/ariadne to format error messages.
Currently, parse errors give fairly cryptic messages. For example, this:
throws an error like:
which is difficult for the user to read. Ideally, we would say something like "at this location, expected a X or a Y."