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
Good catch. But I don't this is feasible to implement, because comments may contain arbitrary text, making it nearly impossible to reliably detect if the /* is inside a "string" or not. For example:
/* Some explanation here.
var c = '"'; /* The ascii value of `"` is 34.
More explanation. */
*/
Here the /* is enclosed between two " characters on the same line, but it's actually part of a nested block comment, and therefore should not be ignored.
I tested with Swift, which also has nested comments, and it doesn't seem to handle strings inside block comments in a special way either.
That wouldn't work because comments can contain text that doesn't lex properly. For example the text "\" is valid in a comment, but lexing would treat is as an unterminated string literal (since the last quote is escaped).
This failed:
with error:
I noticed, that in file
parser/lex.cpp
the functionLexer::readBlockComment
doesn't handle strings.The text was updated successfully, but these errors were encountered: