Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 1 file changed
  • 0 comments
  • 1 contributor
Feb 06, 2012
Ben Newman Revert "quote StringValue with single quotes, a la QuotedStringValue.…
…__str__"

This reverts commit 160de91.
363e963
Ben Newman Promote single-quoted strings to double-quoted strings
- Currently StringValue.__str__ does not print strings with quotes,
  although the base class implementation does.

- Adding single quotes in StringValue.__str__ causes problems
  elsewhere, because StringValue objects are used for things other
  than quoted strings (the !important modifier, for example).

- It seems safer to use QuotedStringValue objects where we know the
  value needs to be a quoted string.
5503519

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. +2 2 scss/__init__.py
4 scss/__init__.py
@@ -4500,7 +4500,7 @@ def merge(self, obj):
4500 4500
4501 4501 class StringValue(QuotedStringValue):
4502 4502 def __str__(self):
4503   - return "'%s'" % escape(self.value)
  4503 + return self.value
4504 4504
4505 4505 def __add__(self, other):
4506 4506 if isinstance(other, ListValue):
@@ -5140,7 +5140,7 @@ def atom(self, R):
5140 5140 return NumberValue(ParserValue(NUM))
5141 5141 elif _token_ == 'STR':
5142 5142 STR = self._scan('STR')
5143   - return StringValue(ParserValue(STR))
  5143 + return QuotedStringValue(ParserValue(STR))
5144 5144 elif _token_ == 'QSTR':
5145 5145 QSTR = self._scan('QSTR')
5146 5146 return QuotedStringValue(ParserValue(QSTR))

No commit comments for this range

Something went wrong with that request. Please try again.