nex3/sass — Issue #287: "Sass" syntax: @import silently fails if an inline comment ends that line
Author: alanhogan
Created: 2012-02-22 00:26:01+00:00
State: open

Demo project:
http://cl.ly/1y0p2F0Z2p0e2T3u0W3H

In main.sass:

@import "colors" // yay
@import "type" // fun
@import "core"
// I guess this is a legal comment, and the above aren’t, in .sass files?

Then:

>>> sass --watch sass:stylesheets
>>> Sass is watching for changes. Press Ctrl-C to stop.
error sass/_core.scss (Line 2: Undefined variable: "$blueberry".)

Note that no error is generated until "core" tries to reference a variable that *should* have been imported, but wasn’t, due to that inline comment.

Notes and observations:

1. I *usually* use `.scss` syntax, but this project is mostly `.sass` — I had no reason to to expect inline comments to break anything, though without semicolons I could sort of see why that may be the case.

2. Still, my syntax highlighter didn’t exactly show any errors, and neither did Sass complain about syntax.

3. This caused me to mis-understand how `@import` actually works in Sass ([Sorry, Chris](http://www.exquisitetweets.com/tweets?eids=mSlda6huXQ.mSlf1YmI4i.mSlrvjHQSi.mSlxD8z1gG.mSnP5UKKeB.mSn1AgxCEK.mSolduLprU.mSou5JgcDt.mSoBkXfc4b.mSp08dKgdE.mSq529Wv9w.mSrazeDyuq.mSrehRIGIe.mSri1l6n12.mSrllLFGbk)).