diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-07-09 10:50:25 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-07-09 10:50:25 +0200 |
| commit | 9950627789358b4d46c7fd8ba20d1428aee7bf01 (patch) | |
| tree | 9cad73f1f7abe6b6768575776d0c3cd1af8c6c33 /tests/typ/code | |
| parent | 4fb58acafde3ca7020a980bd1e0a3585a47ca4f0 (diff) | |
Even shorter error annotations
Error annotations are now relative to the first following non-comment line.
Diffstat (limited to 'tests/typ/code')
| -rw-r--r-- | tests/typ/code/array.typ | 4 | ||||
| -rw-r--r-- | tests/typ/code/block-invalid.typ | 8 | ||||
| -rw-r--r-- | tests/typ/code/call-invalid.typ | 6 | ||||
| -rw-r--r-- | tests/typ/code/closure.typ | 4 | ||||
| -rw-r--r-- | tests/typ/code/comment.typ | 2 | ||||
| -rw-r--r-- | tests/typ/code/dict.typ | 8 | ||||
| -rw-r--r-- | tests/typ/code/import.typ | 22 | ||||
| -rw-r--r-- | tests/typ/code/let.typ | 4 | ||||
| -rw-r--r-- | tests/typ/code/ops-invalid.typ | 10 |
9 files changed, 34 insertions, 34 deletions
diff --git a/tests/typ/code/array.typ b/tests/typ/code/array.typ index 002a792a..9e14bf16 100644 --- a/tests/typ/code/array.typ +++ b/tests/typ/code/array.typ @@ -24,8 +24,8 @@ // Error: 2-3 expected expression, found closing paren {)} -// Error: 2:4 expected comma -// Error: 1:4-1:6 expected expression, found end of block comment +// Error: 4 expected comma +// Error: 4-6 expected expression, found end of block comment {(1*/2)} // Error: 6-8 expected expression, found invalid token diff --git a/tests/typ/code/block-invalid.typ b/tests/typ/code/block-invalid.typ index 7116e86a..01df81d5 100644 --- a/tests/typ/code/block-invalid.typ +++ b/tests/typ/code/block-invalid.typ @@ -7,13 +7,13 @@ {1u} // Should output `1`. -// Error: 2:3 expected semicolon or line break -// Error: 1:4-1:5 cannot join integer with integer +// Error: 3 expected semicolon or line break +// Error: 4-5 cannot join integer with integer {1 2} // Should output `2`. -// Error: 2:12 expected semicolon or line break -// Error: 1:22 expected semicolon or line break +// Error: 12 expected semicolon or line break +// Error: 22 expected semicolon or line break {let x = -1 let y = 3 x + y} // Should output `3`. diff --git a/tests/typ/code/call-invalid.typ b/tests/typ/code/call-invalid.typ index 34aa092d..dd5897b8 100644 --- a/tests/typ/code/call-invalid.typ +++ b/tests/typ/code/call-invalid.typ @@ -10,8 +10,8 @@ // Error: 8 expected comma #args(1 2) -// Error: 2:7-2:8 expected identifier -// Error: 1:9 expected expression +// Error: 7-8 expected identifier +// Error: 9 expected expression #args(1:) // Error: 7-8 expected identifier @@ -34,6 +34,6 @@ {args(} --- -// Error: 3:1 expected quote +// Error: 2:1 expected quote // Error: 2:1 expected closing paren #args("] diff --git a/tests/typ/code/closure.typ b/tests/typ/code/closure.typ index 402df799..20a5f18d 100644 --- a/tests/typ/code/closure.typ +++ b/tests/typ/code/closure.typ @@ -68,7 +68,7 @@ { let f(x) = x + 1 - // Error: 2:10-2:15 unexpected argument - // Error: 1:17-1:24 unexpected argument + // Error: 10-15 unexpected argument + // Error: 17-24 unexpected argument f(1, "two", () => x) } diff --git a/tests/typ/code/comment.typ b/tests/typ/code/comment.typ index 694600d6..407bebd4 100644 --- a/tests/typ/code/comment.typ +++ b/tests/typ/code/comment.typ @@ -21,7 +21,7 @@ https:/* block comments don't ... */ --- // End should not appear without start. -// Error: 1:7-1:9 unexpected end of block comment +// Error: 7-9 unexpected end of block comment /* */ */ // Unterminated is okay. diff --git a/tests/typ/code/dict.typ b/tests/typ/code/dict.typ index b2fd3566..b775f4af 100644 --- a/tests/typ/code/dict.typ +++ b/tests/typ/code/dict.typ @@ -13,8 +13,8 @@ {(a: 1, b)} // Identified as dictionary due to initial colon. -// Error: 4:4-4:5 expected named pair, found expression -// Error: 3:5 expected comma -// Error: 2:12-2:16 expected identifier -// Error: 1:17-1:18 expected expression, found colon +// Error: 4-5 expected named pair, found expression +// Error: 5 expected comma +// Error: 12-16 expected identifier +// Error: 17-18 expected expression, found colon {(:1 b:"", true::)} diff --git a/tests/typ/code/import.typ b/tests/typ/code/import.typ index 18ebd499..e1af8ceb 100644 --- a/tests/typ/code/import.typ +++ b/tests/typ/code/import.typ @@ -69,23 +69,23 @@ --- // Test bad syntax. -// Error: 2:8 expected import items -// Error: 1:8 expected keyword `from` +// Error: 8 expected import items +// Error: 8 expected keyword `from` #import -// Error: 2:9-2:19 expected identifier -// Error: 1:19 expected keyword `from` +// Error: 9-19 expected identifier +// Error: 19 expected keyword `from` #import "file.typ" -// Error: 2:16-2:19 expected identifier -// Error: 1:22 expected keyword `from` +// Error: 16-19 expected identifier +// Error: 22 expected keyword `from` #import afrom, "b", c // Error: 8 expected import items #import from "target.typ" -// Error: 2:9-2:10 expected expression, found assignment operator -// Error: 1:10 expected import items +// Error: 9-10 expected expression, found assignment operator +// Error: 10 expected import items #import = from "target.typ" // Error: 15 expected expression @@ -100,7 +100,7 @@ #from "target.typ" // Should output `target`. -// Error: 2:16-3:2 file not found +// Error: 1:16-2:2 file not found // Error: 2:2 expected semicolon or line break #import * from "target.typ "target @@ -110,8 +110,8 @@ #import * from "target.typ" @ 0.2.1 // A star in the list. -// Error: 2:12-2:13 expected expression, found star -// Error: 1:13-1:14 expected expression, found comma +// Error: 12-13 expected expression, found star +// Error: 13-14 expected expression, found comma #import a, *, b from "target.typ" // An item after a star. diff --git a/tests/typ/code/let.typ b/tests/typ/code/let.typ index d788a563..9079b541 100644 --- a/tests/typ/code/let.typ +++ b/tests/typ/code/let.typ @@ -52,8 +52,8 @@ Three #let v4 = 4 Four // Terminated by semicolon even though we are in a paren group. -// Error: 2:19 expected expression -// Error: 1:19 expected closing paren +// Error: 19 expected expression +// Error: 19 expected closing paren #let v5 = (1, 2 + ; Five #test(v1, 1) diff --git a/tests/typ/code/ops-invalid.typ b/tests/typ/code/ops-invalid.typ index 4090554c..149a60dd 100644 --- a/tests/typ/code/ops-invalid.typ +++ b/tests/typ/code/ops-invalid.typ @@ -25,14 +25,14 @@ // Error: 2-8 cannot apply 'not' to array {not ()} -// Error: 1:2-1:12 cannot apply '<=' to relative and relative +// Error: 2-12 cannot apply '<=' to relative and relative {30% <= 40%} // Special messages for +, -, * and /. -// Error: 4:03-4:10 cannot add integer and string -// Error: 3:12-3:19 cannot subtract integer from relative -// Error: 2:21-2:29 cannot multiply integer with boolean -// Error: 1:31-1:39 cannot divide integer by length +// Error: 03-10 cannot add integer and string +// Error: 12-19 cannot subtract integer from relative +// Error: 21-29 cannot multiply integer with boolean +// Error: 31-39 cannot divide integer by length {(1 + "2", 40% - 1, 2 * true, 3 / 12pt)} // Error: 14-22 cannot apply '+=' to integer and string |
