Skip to content

Commit

Permalink
Update how error codes are printed
Browse files Browse the repository at this point in the history
  • Loading branch information
vcfxb committed Jul 14, 2024
1 parent 6398af2 commit af57b64
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions wright/src/parser/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ impl ParserErrorKind {
None
}

/// Return this [ParserErrorKind] cast to a [u64] preceded by the letters "WPE" standing for "Wright Parser Error".
/// Return this [ParserErrorKind] cast to a [u64], adding 1, preceded by the letters "WPE" standing for "Wright Parser Error".
pub fn error_code_string(self) -> String {
format!("WPE{}", self as u64)
format!("WPE{}", self as u64 + 1)
}
}

Expand Down
4 changes: 2 additions & 2 deletions wright/tests/parser.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg(all(feature = "reporting", feature = "parsing"))]
#![cfg(all(feature = "reporting", feature = "parser"))]

use termcolor::Buffer;
use wright::{
Expand All @@ -23,7 +23,7 @@ fn test_parse_fail_identifier_to_diagnostic() -> anyhow::Result<()> {
assert_eq!(
std::str::from_utf8(buffer.as_slice())?,
"\
error[WPE2]: expected identifier
error[WPE3]: expected identifier
┌─ <NO_NAME>:1:1
1 │ 12345
Expand Down

0 comments on commit af57b64

Please sign in to comment.