Merge pull request #6166 from roc-lang/dbg-off-by-one

fix off by one in roc_dbg
This commit is contained in:
Ayaz 2023-12-03 11:13:08 -06:00 committed by GitHub
commit 7db2594be4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 6 deletions

View File

@ -562,11 +562,12 @@ mod cli_run {
words : List Str
words = ["this", "will", "for", "sure", "be", "a", "large", "string", "so", "when", "we", "split", "it", "it", "will", "use", "seamless", "slices", "which", "affect", "printing"]
[<ignored for tests>:21] x = 42
[<ignored for tests>:22] "Fjoer en ferdjer frieten oan dyn geve lea" = "Fjoer en ferdjer frieten oan dyn geve lea"
[<ignored for tests>:12] x = "abc"
[<ignored for tests>:12] x = 10
[<ignored for tests>:12] x = (A (B C))
[<ignored for tests>:22] x = 42
[<ignored for tests>:23] "Fjoer en ferdjer frieten oan dyn geve lea" = "Fjoer en ferdjer frieten oan dyn geve lea"
[<ignored for tests>:24] "this is line 24" = "this is line 24"
[<ignored for tests>:13] x = "abc"
[<ignored for tests>:13] x = 10
[<ignored for tests>:13] x = (A (B C))
Program finished!
"#
),

View File

@ -21,6 +21,7 @@ main =
x = 42
dbg x
dbg "Fjoer en ferdjer frieten oan dyn geve lea"
dbg "this is line 24"
r = {x : polyDbg "abc", y: polyDbg 10u8, z : polyDbg (A (B C))}

View File

@ -661,7 +661,7 @@ pub fn desugar_expr<'a>(
arena.alloc(Loc {
value: LowLevelDbg(
arena.alloc((
&*arena.alloc_str(&format!("{}:{}", module_path, line_col.line)),
&*arena.alloc_str(&format!("{}:{}", module_path, line_col.line + 1)),
&*arena.alloc_str(dbg_src),
)),
dbg_str,