summaryrefslogtreecommitdiff
path: root/scss/src
diff options
context:
space:
mode:
authorEevee <eevee.git@veekun.com>2013-07-10 12:50:57 -0700
committerEevee <eevee.git@veekun.com>2013-07-10 12:50:57 -0700
commita25b27a1ceb5d6a5429c3fa9e09b34e8442f2951 (patch)
treea7f588c1a9ace7611f3a0250238c449fec319dce /scss/src
parentdd66433e438292ef67fec00d41abe58f5560e6b1 (diff)
downloadpyscss-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.g4
-rw-r--r--scss/src/grammar/grammar.py4
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)))