diff options
author | Eevee <eevee.git@veekun.com> | 2013-07-10 12:50:57 -0700 |
---|---|---|
committer | Eevee <eevee.git@veekun.com> | 2013-07-10 12:50:57 -0700 |
commit | a25b27a1ceb5d6a5429c3fa9e09b34e8442f2951 (patch) | |
tree | a7f588c1a9ace7611f3a0250238c449fec319dce /scss/src | |
parent | dd66433e438292ef67fec00d41abe58f5560e6b1 (diff) | |
download | pyscss-a25b27a1ceb5d6a5429c3fa9e09b34e8442f2951.tar.gz |
Rewrite the String type.
Unifies quoted and unquoted strings. Single quotes are now preserved.
Also moves the result of `type-of` into the type system, hurrah.
Diffstat (limited to 'scss/src')
-rw-r--r-- | scss/src/grammar/grammar.g | 4 | ||||
-rw-r--r-- | scss/src/grammar/grammar.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/scss/src/grammar/grammar.g b/scss/src/grammar/grammar.g index 974035b..9aaaffb 100644 --- a/scss/src/grammar/grammar.g +++ b/scss/src/grammar/grammar.g @@ -90,9 +90,9 @@ parser SassExpression: UNITS {{ return Literal(NumberValue(float(NUM), type=UNITS)) }} ] {{ return Literal(NumberValue(float(NUM))) }} | - STR {{ return Literal(StringValue(ParserValue(STR))) }} + STR {{ return Literal(String(STR[1:-1], quotes="'")) }} | - QSTR {{ return Literal(QuotedStringValue(ParserValue(QSTR))) }} + QSTR {{ return Literal(String(QSTR[1:-1], quotes='"')) }} | COLOR {{ return Literal(ColorValue(ParserValue(COLOR))) }} | diff --git a/scss/src/grammar/grammar.py b/scss/src/grammar/grammar.py index e25a851..0cf0931 100644 --- a/scss/src/grammar/grammar.py +++ b/scss/src/grammar/grammar.py @@ -190,10 +190,10 @@ class SassExpression(Parser): return Literal(NumberValue(float(NUM))) elif _token_ == 'STR': STR = self._scan('STR') - return Literal(StringValue(ParserValue(STR))) + return Literal(String(STR[1:-1], quotes="'")) elif _token_ == 'QSTR': QSTR = self._scan('QSTR') - return Literal(QuotedStringValue(ParserValue(QSTR))) + return Literal(String(QSTR[1:-1], quotes='"')) elif _token_ == 'COLOR': COLOR = self._scan('COLOR') return Literal(ColorValue(ParserValue(COLOR))) |