summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authortingerrr <me@tinger.dev>2023-11-07 12:14:20 +0100
committerGitHub <noreply@github.com>2023-11-07 12:14:20 +0100
commit5f922abfd840425f347b7b86b1d0d81e489faf8d (patch)
tree833978f733e761e625334224a51462039866b64f /tests
parent241a6d9e5aa36c41e1f3be8a75a769e2ce98f7fb (diff)
Add hints for invalid identifier errors (#2583)
Diffstat (limited to 'tests')
-rw-r--r--tests/typ/compiler/embedded-expr.typ2
-rw-r--r--tests/typ/compiler/hint.typ6
2 files changed, 6 insertions, 2 deletions
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
}