Fixed single quote escaping

BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org//126063003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31578 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
terry@google.com 2014-01-07 21:32:07 +00:00
parent 4b6fb5546a
commit 6d41224b82
4 changed files with 9 additions and 3 deletions

View file

@ -1494,6 +1494,9 @@ class _Parser {
value = double.parse(termToken.text);
break;
case TokenKind.SINGLE_QUOTE:
value = processQuotedString(false);
value = "'${_escapeString(value, single: true)}'";
return new LiteralTerm(value, value, _makeSpan(start));
case TokenKind.DOUBLE_QUOTE:
value = processQuotedString(false);
value = '"${_escapeString(value)}"';
@ -2129,6 +2132,9 @@ class _Parser {
value = double.parse("${unary}${t.text}");
break;
case TokenKind.SINGLE_QUOTE:
value = processQuotedString(false);
value = "'${_escapeString(value, single: true)}'";
return new LiteralTerm(value, value, _makeSpan(start));
case TokenKind.DOUBLE_QUOTE:
value = processQuotedString(false);
value = '"${_escapeString(value)}"';

View file

@ -1,5 +1,5 @@
name: csslib
version: 0.9.1
version: 0.9.2
author: "Polymer.dart Team <web-ui-dev@dartlang.org>"
description: A library for parsing CSS.
homepage: https://www.dartlang.org

View file

@ -591,7 +591,7 @@ div:nth-child(2n) { color : red; }
expect(errors.isEmpty, true, reason: errors.toString());
expect(prettyPrint(stylesheet), r'''
html:lang(fr-ca) {
quotes: "\" " " \"";
quotes: '" ' ' "';
}
zoom {
}

View file

@ -258,7 +258,7 @@ void testUnicode() {
final String generated = r'''
.toggle:after {
content: "";
content: '';
line-height: 43px;
font-size: 20px;
color: #d9d9d9;