From 84cdc85ca7494368e7ce2039fcef06ac2d3bd2ed Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 17 Feb 2021 23:07:28 +0100 Subject: =?UTF-8?q?Refresh=20parser=20=F0=9F=8C=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/lang/ref/call-invalid.png | Bin 1766 -> 1729 bytes tests/lang/ref/for-invalid.png | Bin 1484 -> 1653 bytes tests/lang/typ/block-invalid.typ | 2 +- tests/lang/typ/call-invalid.typ | 4 ++-- tests/lang/typ/call-value.typ | 2 +- tests/lang/typ/comment.typ | 2 +- tests/lang/typ/emph.typ | 2 +- tests/lang/typ/expr-invalid.typ | 10 +++++----- tests/lang/typ/expr-prec.typ | 2 +- tests/lang/typ/for-invalid.typ | 4 ++-- tests/lang/typ/if-invalid.typ | 2 +- tests/library/typ/image.typ | 4 ++-- 12 files changed, 17 insertions(+), 17 deletions(-) (limited to 'tests') diff --git a/tests/lang/ref/call-invalid.png b/tests/lang/ref/call-invalid.png index 0bceebc1..05db4b7e 100644 Binary files a/tests/lang/ref/call-invalid.png and b/tests/lang/ref/call-invalid.png differ diff --git a/tests/lang/ref/for-invalid.png b/tests/lang/ref/for-invalid.png index fa65f495..d758aa95 100644 Binary files a/tests/lang/ref/for-invalid.png and b/tests/lang/ref/for-invalid.png differ diff --git a/tests/lang/typ/block-invalid.typ b/tests/lang/typ/block-invalid.typ index 28874861..d98bf06b 100644 --- a/tests/lang/typ/block-invalid.typ +++ b/tests/lang/typ/block-invalid.typ @@ -20,7 +20,7 @@ // Error: 9-12 expected identifier, found string for "v" - // Error: 10 expected keyword `#in` + // Error: 10 expected keyword `in` for v let z = 1 + 2 z diff --git a/tests/lang/typ/call-invalid.typ b/tests/lang/typ/call-invalid.typ index a04f5959..153f7a39 100644 --- a/tests/lang/typ/call-invalid.typ +++ b/tests/lang/typ/call-invalid.typ @@ -7,7 +7,7 @@ --- #let x = "string" -// Error: 2-3 expected function, found string +// Error: 1-3 expected function, found string #x() --- @@ -20,5 +20,5 @@ --- // Error: 3:1 expected quote -// Error: 2:1 expected closing bracket +// Error: 2:1 expected closing paren #f("] diff --git a/tests/lang/typ/call-value.typ b/tests/lang/typ/call-value.typ index 0e257717..26e48d0f 100644 --- a/tests/lang/typ/call-value.typ +++ b/tests/lang/typ/call-value.typ @@ -2,7 +2,7 @@ // Ref: false --- -// Whitespace is insignificant. +// Whitespace is significant. #test(type(1), "integer") #test (type (1), "integer") diff --git a/tests/lang/typ/comment.typ b/tests/lang/typ/comment.typ index e5892453..25180211 100644 --- a/tests/lang/typ/comment.typ +++ b/tests/lang/typ/comment.typ @@ -11,7 +11,7 @@ C/* */D // Works in code. -#test(type /*1*/ (1) // +#test(type(/*1*/ 1) // , "integer") --- diff --git a/tests/lang/typ/emph.typ b/tests/lang/typ/emph.typ index 8e5812a8..772e15ab 100644 --- a/tests/lang/typ/emph.typ +++ b/tests/lang/typ/emph.typ @@ -8,7 +8,7 @@ _Emphasized!_ Partly em_phas_ized. // Scoped to body. -#[box][_Scoped] to body. +#box[_Scoped] to body. // Unterminated is fine. _The End diff --git a/tests/lang/typ/expr-invalid.typ b/tests/lang/typ/expr-invalid.typ index 329a2616..f760ae31 100644 --- a/tests/lang/typ/expr-invalid.typ +++ b/tests/lang/typ/expr-invalid.typ @@ -35,22 +35,22 @@ // Error: 1:31-1:39 cannot divide integer by length {(1 + "2", 40% - 1, 2 * true, 3 / 12pt)} -// Error: 15-23 cannot apply '+=' to integer and string +// Error: 14-22 cannot apply '+=' to integer and string { let x = 1; x += "2" } --- // Bad left-hand sides of assignment. -// Error: 1:3-1:6 cannot assign to this expression +// Error: 3-6 cannot assign to this expression { (x) = "" } -// Error: 1:3-1:8 cannot assign to this expression +// Error: 3-8 cannot assign to this expression { 1 + 2 += 3 } -// Error: 1:3-1:4 unknown variable +// Error: 3-4 unknown variable { z = 1 } -// Error: 1:3-1:6 cannot assign to a constant +// Error: 3-6 cannot assign to a constant { box = "hi" } // Works if we define box beforehand diff --git a/tests/lang/typ/expr-prec.typ b/tests/lang/typ/expr-prec.typ index 738e8fdf..e64e583c 100644 --- a/tests/lang/typ/expr-prec.typ +++ b/tests/lang/typ/expr-prec.typ @@ -21,7 +21,7 @@ #test((1), 1) #test((1+2)*-3, -9) -// Error: 15 expected closing paren +// Error: 14 expected closing paren #test({(1 + 1}, 2) --- diff --git a/tests/lang/typ/for-invalid.typ b/tests/lang/typ/for-invalid.typ index 3866909f..c8bdebdd 100644 --- a/tests/lang/typ/for-invalid.typ +++ b/tests/lang/typ/for-invalid.typ @@ -4,7 +4,7 @@ // Error: 5-5 expected identifier #for -// Error: 7-7 expected keyword `#in` +// Error: 7-7 expected keyword `in` #for v // Error: 10-10 expected expression @@ -28,5 +28,5 @@ A#for "v" thing. #for "v" in iter {} // Should output `+ b in iter`. -// Error: 7 expected keyword `#in` +// Error: 7 expected keyword `in` #for a + b in iter {} diff --git a/tests/lang/typ/if-invalid.typ b/tests/lang/typ/if-invalid.typ index 166de122..6d2deab1 100644 --- a/tests/lang/typ/if-invalid.typ +++ b/tests/lang/typ/if-invalid.typ @@ -10,7 +10,7 @@ // Error: 6 expected body #if x -// Error: 1-6 unexpected keyword `#else` +// Error: 1-6 unexpected keyword `else` #else {} --- diff --git a/tests/library/typ/image.typ b/tests/library/typ/image.typ index 8bf972b2..9c3cd4fe 100644 --- a/tests/library/typ/image.typ +++ b/tests/library/typ/image.typ @@ -7,10 +7,10 @@ // Load an RGB JPEG image. #image("res/tiger.jpg") -// Error: 9-30 failed to load image +// Error: 8-29 failed to load image #image("path/does/not/exist") -// Error: 9-30 failed to load image +// Error: 8-29 failed to load image #image("typ/image-error.typ") --- -- cgit v1.2.3