From 017027bf392f7be2e73428fa34a3d1ef0b8d255e Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 24 May 2023 16:58:51 +0200 Subject: Rework delimiter errors Fixes #572 --- tests/typ/compiler/array.typ | 4 ++-- tests/typ/compiler/block.typ | 2 +- tests/typ/compiler/call.typ | 7 ++++--- tests/typ/compiler/let.typ | 2 +- tests/typ/compiler/ops-prec.typ | 2 +- tests/typ/compiler/string.typ | 2 +- tests/typ/math/syntax.typ | 2 +- tests/typ/meta/link.typ | 2 +- tests/typ/text/emphasis.typ | 8 ++++---- tests/typ/text/escape.typ | 2 +- tests/typ/text/raw.typ | 2 +- 11 files changed, 18 insertions(+), 17 deletions(-) (limited to 'tests/typ') diff --git a/tests/typ/compiler/array.typ b/tests/typ/compiler/array.typ index 59e9f70b..a96a800f 100644 --- a/tests/typ/compiler/array.typ +++ b/tests/typ/compiler/array.typ @@ -256,10 +256,10 @@ #(1, 2, 3).at(-4) --- -// Error: 4 expected closing paren +// Error: 3-4 unclosed delimiter #{(} -// Error: 3-4 unexpected closing paren +// Error: 2-3 unclosed delimiter #{)} // Error: 4-6 unexpected end of block comment diff --git a/tests/typ/compiler/block.typ b/tests/typ/compiler/block.typ index 81c719da..386994e9 100644 --- a/tests/typ/compiler/block.typ +++ b/tests/typ/compiler/block.typ @@ -138,7 +138,7 @@ } --- -// Error: 3 expected closing brace +// Error: 2-3 unclosed delimiter #{ --- diff --git a/tests/typ/compiler/call.typ b/tests/typ/compiler/call.typ index 04eb2906..77e17b50 100644 --- a/tests/typ/compiler/call.typ +++ b/tests/typ/compiler/call.typ @@ -94,13 +94,14 @@ #func((x):1) --- -// Error: 2:1 expected closing bracket +// Error: 6-7 unclosed delimiter #func[`a]` --- -// Error: 8 expected closing paren +// Error: 7-8 unclosed delimiter #{func(} --- -// Error: 2:1 expected quote +// Error: 6-7 unclosed delimiter +// Error: 1:7-2:1 unclosed string #func("] diff --git a/tests/typ/compiler/let.typ b/tests/typ/compiler/let.typ index d9940a8c..825f9e7b 100644 --- a/tests/typ/compiler/let.typ +++ b/tests/typ/compiler/let.typ @@ -227,7 +227,7 @@ Three // Terminated by semicolon even though we are in a paren group. // Error: 18 expected expression -// Error: 18 expected closing paren +// Error: 11-12 unclosed delimiter #let v5 = (1, 2 + ; Five // Error: 9-13 expected identifier, found boolean diff --git a/tests/typ/compiler/ops-prec.typ b/tests/typ/compiler/ops-prec.typ index b90030f8..d3fe01b5 100644 --- a/tests/typ/compiler/ops-prec.typ +++ b/tests/typ/compiler/ops-prec.typ @@ -32,5 +32,5 @@ #test((1), 1) #test((1+2)*-3, -9) -// Error: 14 expected closing paren +// Error: 8-9 unclosed delimiter #test({(1 + 1}, 2) diff --git a/tests/typ/compiler/string.typ b/tests/typ/compiler/string.typ index ddd0f7ff..9a4b4146 100644 --- a/tests/typ/compiler/string.typ +++ b/tests/typ/compiler/string.typ @@ -204,5 +204,5 @@ #test("a123c".split(regex("\d+")), ("a", "c")) --- -// Error: 2:1 expected quote +// Error: 2-2:1 unclosed string #"hello\" diff --git a/tests/typ/math/syntax.typ b/tests/typ/math/syntax.typ index 8970fc93..503d3031 100644 --- a/tests/typ/math/syntax.typ +++ b/tests/typ/math/syntax.typ @@ -18,5 +18,5 @@ $ underline(f' : NN -> RR) \ $ dot \ dots \ ast \ tilde \ star $ --- -// Error: 1:3 expected dollar sign +// Error: 1-2 unclosed delimiter $a diff --git a/tests/typ/meta/link.typ b/tests/typ/meta/link.typ index 36f88f90..37eba6b7 100644 --- a/tests/typ/meta/link.typ +++ b/tests/typ/meta/link.typ @@ -35,7 +35,7 @@ https://example.com/) --- // Verify that opening brackets without closing brackets throw an error. -// Error: 22-22 expected closing bracket in link +// Error: 1-22 automatic links cannot contain unbalanced brackets, use the `link` function instead https://exam(ple.com/ --- diff --git a/tests/typ/text/emphasis.typ b/tests/typ/text/emphasis.typ index 0191ac87..fd04c8e7 100644 --- a/tests/typ/text/emphasis.typ +++ b/tests/typ/text/emphasis.typ @@ -27,17 +27,17 @@ Normal *Medium* and *#[*Bold*]* --- -// Error: 13 expected underscore +// Error: 6-7 unclosed delimiter #box[_Scoped] to body. --- // Ends at paragraph break. -// Error: 7 expected underscore +// Error: 1-2 unclosed delimiter _Hello World --- -// Error: 26 expected star -// Error: 26 expected underscore +// Error: 11-12 unclosed delimiter +// Error: 3-4 unclosed delimiter #[_Cannot *be interleaved] diff --git a/tests/typ/text/escape.typ b/tests/typ/text/escape.typ index e7ec9023..8e557918 100644 --- a/tests/typ/text/escape.typ +++ b/tests/typ/text/escape.typ @@ -32,5 +32,5 @@ let f() , ; : | + - /= == 12 "string" --- // Unterminated. -// Error: 6 expected closing brace +// Error: 1-6 unclosed unicode escape sequence \u{41[*Bold*] diff --git a/tests/typ/text/raw.typ b/tests/typ/text/raw.typ index 1040151c..8cf5ee7e 100644 --- a/tests/typ/text/raw.typ +++ b/tests/typ/text/raw.typ @@ -55,5 +55,5 @@ The keyword ```rust let```. --- // Unterminated. -// Error: 2:1 expected 1 backtick +// Error: 1-2:1 unclosed raw text `endless -- cgit v1.2.3