-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comment line error: expected type expression, found 'invalid token' #20937
Comments
After I took a look in the binary version of the source code, I found the reason for this error. There is a TAB in the comment. |
@alexrp Thanks. Didn't find that issue because I searched for the error message. |
zig could at least say that it's a tab, not just 'invalid token'. quite unhelpful with such invisible characters. |
Why is that a valid reason to error? Comments should have no restrictions on content. |
Yes and no. Comments can be used to automatically generate documentation. In this case, it's also content. |
But for documentation zig has special syntax of comments. Why the regular comments should have any restrictions? |
This is not good design or considerate to the developer due to a white character being quite difficult to debug. Some additional context around the invalid "token" would be much better and likely save thousands of cumulative man hours of debugging and unraveling the mystery of Where's Wally. |
This is a duplicate of #20900 |
Zig Version
0.14.0-dev.839+a931bfada
Steps to Reproduce and Observed Behavior
In the ziglings exercises "103_tokenization.zig" the compiler throws an error from a comment line.
Here is an extract of the exercise to reproduce the error:
Expected Behavior
No error.
The text was updated successfully, but these errors were encountered: