Kronuz / pyScss

pyScss, a Scss compiler for Python
MIT License
582 stars 141 forks source link

Some syntax errors produce no useful output #283

Closed qris closed 10 years ago

qris commented 10 years ago

The missing parenthesis in this expression doesn't result in any error, but just empty output, subtly breaking my CSS:

>>> compiler.compile("a {  margin-left: #{((($narrow_column_width * 1em - 1.5em) / 2)};")
''

While fixing the syntax error produces a decent error about an unknown variable:

>>> compiler.compile("a {  margin-left: #{((($narrow_column_width * 1em - 1.5em) / 2)) };")
Traceback (most recent call last):
SyntaxError: Undefined variable: '$narrow_column_width'.
eevee commented 10 years ago

Turns out there was already code for this, but it was broken due to a tiny bug in the speedups module. Fixed in master, though the error is still not terribly specific about where the problem is :)