mirror of
https://github.com/ruuda/rcl.git
synced 2025-12-23 04:47:19 +00:00
Lexing from \u{ until the closing } works for valid documents, but if
you forget the closing }, it will go also past the closing " and create
very puzzling errors. So limit what we parse to hex digits then, and
report the errors slightly differently.
14 lines
335 B
Text
14 lines
335 B
Text
f"This f-string is not closed.{0 0}"
|
|
|
|
# output:
|
|
stdin:1:34
|
|
╷
|
|
1 │ f"This f-string is not closed.{0 0}"
|
|
╵ ^
|
|
Error: Expected '}' here to close format string hole.
|
|
|
|
stdin:1:31
|
|
╷
|
|
1 │ f"This f-string is not closed.{0 0}"
|
|
╵ ^
|
|
Note: Unmatched '{' opened here.
|