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/if.typ | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tests/typ/code/if.typ') diff --git a/tests/typ/code/if.typ b/tests/typ/code/if.typ index dd5d23a0..db8b059e 100644 --- a/tests/typ/code/if.typ +++ b/tests/typ/code/if.typ @@ -39,9 +39,16 @@ "Four" + point } +// Template can be argument or body depending on whitespace. +{ + if "template" == type[b] [Fi] else [Nope] + if "template" == type [Nope] else [ve.] +} + --- // Value of if expressions. // Ref: false + { let x = 1 let y = 2 @@ -61,13 +68,12 @@ } --- -// Ref: false - // Condition must be boolean. // If it isn't, neither branch is evaluated. // Error: 5-14 expected boolean, found string #if "a" + "b" { nope } #else { nope } +--- // Make sure that we don't complain twice. // Error: 5-12 cannot add integer and string #if 1 + "2" {} -- cgit v1.2.3