From 5f922abfd840425f347b7b86b1d0d81e489faf8d Mon Sep 17 00:00:00 2001 From: tingerrr Date: Tue, 7 Nov 2023 12:14:20 +0100 Subject: Add hints for invalid identifier errors (#2583) --- tests/typ/compiler/embedded-expr.typ | 2 ++ tests/typ/compiler/hint.typ | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/typ/compiler/embedded-expr.typ b/tests/typ/compiler/embedded-expr.typ index ecdd86a9..c95184e4 100644 --- a/tests/typ/compiler/embedded-expr.typ +++ b/tests/typ/compiler/embedded-expr.typ @@ -3,11 +3,13 @@ --- // Error: 6-8 expected identifier, found keyword `as` +// Hint: 6-8 keyword `as` is not allowed as an identifier; try `as_` instead #let as = 1 + 2 --- #{ // Error: 7-9 expected identifier, found keyword `as` + // Hint: 7-9 keyword `as` is not allowed as an identifier; try `as_` instead let as = 10 } diff --git a/tests/typ/compiler/hint.typ b/tests/typ/compiler/hint.typ index 6b60eafb..1a5efcaa 100644 --- a/tests/typ/compiler/hint.typ +++ b/tests/typ/compiler/hint.typ @@ -11,13 +11,15 @@ a = 1-a a = a -1 - // Error: 7-10 unknown variable: a-1 - if you meant to use subtraction, try adding spaces around the minus sign. + // Error: 7-10 unknown variable: a-1 + // Hint: 7-10 if you meant to use subtraction, try adding spaces around the minus sign a = a-1 } --- #{ - // Error: 3-6 unknown variable: a-1 - if you meant to use subtraction, try adding spaces around the minus sign. + // Error: 3-6 unknown variable: a-1 + // Hint: 3-6 if you meant to use subtraction, try adding spaces around the minus sign a-1 = 2 } -- cgit v1.2.3