From 1ee1d078e2480ddd08d40915bc7a74a8352acff0 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Fri, 30 Jul 2021 18:04:08 +0200 Subject: Fatal errors - Makes errors fatal, so that a phase is only reached when all previous phases were error-free - Parsing still recovers and can produce multiple errors - Evaluation fails fast and can thus produce only a single error (except for parse errors due to an import) - The single error that could occur during execution is removed for now - Removes Value::Error variant --- tests/typ/code/while.typ | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'tests/typ/code/while.typ') diff --git a/tests/typ/code/while.typ b/tests/typ/code/while.typ index 306c1e45..2f0984d2 100644 --- a/tests/typ/code/while.typ +++ b/tests/typ/code/while.typ @@ -29,23 +29,16 @@ #test(type(while i < 1 [{ i += 1 }]), "template") --- -// Ref: false - // Condition must be boolean. // Error: 8-14 expected boolean, found template #while [nope] [nope] -// Make sure that we don't complain twice. -// Error: 8-15 unknown variable -#while nothing {} - -// Errors taint everything. -#let i = 0 -#test(error, while i < 10 { - i += 1 - if i < 5 [nope] else { error } -}) -#test(i, 10) +--- +// Make sure that we terminate and don't complain multiple times. +#while true { + // Error: 5-9 unknown variable + nope +} --- // Error: 7 expected expression @@ -57,11 +50,9 @@ // Error: 9 expected body #while x -// Should output `x`. // Error: 7 expected expression #while x {} -// Should output `something`. // Error: 9 expected body #while x something -- cgit v1.2.3