-
Notifications
You must be signed in to change notification settings - Fork 466
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
Syntax: Multiline comments break for unsupported features #424
Comments
Ops, I must have misread it. I thought the fixes are related to the SASS 3.x syntax functions, which (I guess) is causing this multi-line comments issue. :) |
Hmm, the text inside multi-line comments is interpreted by LibSass because things like variable substitutions are allowed, but it looks like it needs to treat the comment as raw text when interpretation would result in errors. |
@akhleung, thanks! I tried changing it here: Line 47 in 97e5346
String* contents;
try {
contents = parse_interpolated_chunk(lexed);
}
catch (Error& err) {
contents = new (ctx.mem) String_Schema(lexed, source_position);
} and few other varieties in catch-block, but it still throws. Any pointers on where to look to make it parse the comment as text (in case comment-code result in error)? |
We definitely need a simpler test case here... |
So I was playing around with this to find a working test case, but Sass 3.4 seems to throw an error for this, too. Sass errors because there's no variable "$header" – meaning that it's seeing and trying to interpret the variable, but doesn't pay attention to the values given to it by the @each line. http://sassmeister.com/gist/0277dd12d32a99cd97fd It looks like libsass (at least in Sassmeister) gives a similar error about unbound variables. Could this be a Ruby Sass bug too? |
(Note: if I set the variable "$header: h1" in either example before the comment, the code works fine.) |
So if you're following the Sass issue, it looks like this is intended behaviour. See the comment by lolmaus here: sass/sass#1465 (comment) |
Soooooooo, yeah, it now dawns on me what's going on here. This exact same sample causes the same error, because Sass interpolates inside of comments. The
If |
@malrase, thanks for looking into it. But wouldn't @akhleung's approach (above) makes sense? If it throws error in multi-line comments, wouldn't it be nice to raise a warning instead of syntax error? Something like:
|
I think that might be nice, but we have to stick with Sass' choices right now. Maybe open an issue there, as I agree with you. On Tue, Oct 7, 2014 at 1:11 PM, Adeel Mujahid notifications@github.com
|
While testing this issue: madskristensen/WebEssentials2013#1162, I came across a bug with multiline comments.
This code:
compiles to:
But this:
throws on compile (as maps with multi-vars are not supported yet: #394).
But with single-line comments:
it compiles to:
(Also note: multi-line comments are retained in the output, while single-line comments are not. I think they can be transformed to multi-line comments syntax for CSS valid output)
The text was updated successfully, but these errors were encountered: