summaryrefslogtreecommitdiff
path: root/scss/expression.py
diff options
context:
space:
mode:
authorEevee (Alex Munroe) <eevee.git@veekun.com>2013-08-23 16:21:43 -0700
committerEevee (Alex Munroe) <eevee.git@veekun.com>2013-08-23 16:21:43 -0700
commit930e7382d41f450f8aa4bb29649204683a07353a (patch)
treed33c4980bd21373868a812029d0092b47e7521f5 /scss/expression.py
parent444ac8f8b4e5d167050b3d0eb0869bce5335aa33 (diff)
downloadpyscss-parsley.tar.gz
Map literals in Parsley, and a few other minor fixes.parsley
- Labels for some of the rules. - Faux goal_argspec rule to play nicely with parse_expression. - Wrap ParseErrors in SassParseError. - Ruby's interp-and-slash test now passes exactly. - Don't render nulls in an interpolation.
Diffstat (limited to 'scss/expression.py')
-rw-r--r--scss/expression.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/scss/expression.py b/scss/expression.py
index ebec7e2..bd19031 100644
--- a/scss/expression.py
+++ b/scss/expression.py
@@ -29,7 +29,7 @@ log = logging.getLogger(__name__)
FATAL_UNDEFINED = True
-from ometa.runtime import EOFError, OMetaBase, expected
+from ometa.runtime import EOFError, OMetaBase, ParseError, expected
import string
HEXDIGITS = frozenset(string.hexdigits)
WHITESPACE = frozenset(' \n\r\t\f')
@@ -224,7 +224,7 @@ class Calculator(object):
ast = getattr(parser, target)()
print(repr(ast))
- except SyntaxError as e:
+ except (SyntaxError, ParseError) as e:
raise SassParseError(e, expression=expr, expression_pos=parser._char_pos)
self.ast_cache[key] = ast
@@ -551,7 +551,9 @@ class Interpolation(Expression):
ret = []
for part in self.parts:
expr = part.evaluate(calculator)
- if isinstance(expr, String):
+ if expr.is_null:
+ pass
+ elif isinstance(expr, String):
ret.append(expr.value)
else:
ret.append(expr.render())