You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since release 0.11, context is a new reserved keyword, but if an unwitting user wants to define a variable named context, the error message is confusing:
#letcontext=1+2// actual error: 1:6-1:13 expected pattern, found `context` expression// I suggest: 1:6-1:13 expected identifier name, found keyword `context`
Similar but different, because the error highlighted the entire let = 1 + 2 part, not just the second let word:
#letlet=1+2// actual error: 1:6-1:17 expected pattern, found `let` expression// I suggest: 1:6-1:9 expected identifier name, found keyword `let`
Note the highlighted span (1:6-1:17) let = 1 + 2 is actually not a valid "let expression" either -- it's missing the identifier.
Okay-ish because it says as is a keyword and there's an hint, but the word "pattern" here is still confusing to users. Note it does not refer to Typst's pattern type.
#letas=1+2// actual output:// Error: 1:6-1:8 expected pattern, found keyword `as`// Hint: 1:6-1:8 keyword `as` is not allowed as an identifier; try `as_` instead
Typst thrives on clear error messages (much clearer than LaTeX :) ), so I think it's worth improvement in these cases.
Reproduction URL
No response
Operating system
Web app, Windows, Linux, macOS
Typst version
I am using the latest version of Typst
The text was updated successfully, but these errors were encountered:
Description
Since release 0.11,
context
is a new reserved keyword, but if an unwitting user wants to define a variable namedcontext
, the error message is confusing:Similar but different, because the error highlighted the entire
let = 1 + 2
part, not just the secondlet
word:Note the highlighted span (1:6-1:17)
let = 1 + 2
is actually not a valid "let
expression" either -- it's missing the identifier.Okay-ish because it says
as
is a keyword and there's an hint, but the word "pattern" here is still confusing to users. Note it does not refer to Typst'spattern
type.Typst thrives on clear error messages (much clearer than LaTeX :) ), so I think it's worth improvement in these cases.
Reproduction URL
No response
Operating system
Web app, Windows, Linux, macOS
Typst version
The text was updated successfully, but these errors were encountered: