diff options
author | Eevee (Alex Munroe) <eevee.git@veekun.com> | 2014-09-04 14:35:03 -0700 |
---|---|---|
committer | Eevee (Alex Munroe) <eevee.git@veekun.com> | 2014-09-04 14:35:03 -0700 |
commit | e2a5d7c95d7f9dcbb3c79bb1d6eed43bded8d667 (patch) | |
tree | be4dd9ebb468f2af7cbeb8c6523cd804517e2ae4 /yapps2.py | |
parent | 493a349952b18332da31cb7828e4d78124b7f236 (diff) | |
download | pyscss-e2a5d7c95d7f9dcbb3c79bb1d6eed43bded8d667.tar.gz |
Lots of fixes to gritty details of how Sass treats url().
Basically: if it looks like it's a single bare URL, only interpolations
are allowed. Otherwise, it's expected to be a whole expression.
Handling of interpolation in barewords is much improved.
Also fixed the wrapping of SassSyntaxError.
Diffstat (limited to 'yapps2.py')
-rwxr-xr-x | yapps2.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -747,7 +747,9 @@ class Scanner(object): msg = "Bad Token" if restrict: msg = "Trying to find one of " + ", ".join(restrict) - raise SyntaxError("SyntaxError[@ char %s: %s]" % (repr(self.pos), msg)) + err = SyntaxError("SyntaxError[@ char %s: %s]" % (repr(self.pos), msg)) + err.pos = self.pos + raise err # If we found something that isn't to be ignored, return it if best_pat in self.ignore: @@ -875,7 +877,9 @@ class Parser(object): """ tok = self._scanner.token(self._pos, set([type])) if tok[2] != type: - raise SyntaxError("SyntaxError[@ char %s: %s]" % (repr(tok[0]), "Trying to find " + type)) + err = SyntaxError("SyntaxError[@ char %s: %s]" % (repr(tok[0]), "Trying to find " + type)) + err.pos = tok[0] + raise err self._pos += 1 return tok[3] |