This repository was archived by the owner on Nov 1, 2024. It is now read-only.
Commit 33b1f2a
committed
Support parsing identifiers with escape codes in them
The output of `CssPrinter` will now also retain escape codes in identifiers.
This ensures they remain valid identifiers, as the escaped values may not parse
as valid identifiers.
The parser will also no longer accept an ID or class selector with space between
the first token (`#` or `.` respectively) and the identifier. The parser will
now fail immediately on these selector errors instead of attempting to recover.
Recovering in a robust manner is difficult given that this parser immediately
attempts to parse at the selector granularity, rather than first parsing the
style sheet into rules as described [here][parse-rule].
[parse-rule]: https://www.w3.org/TR/css-syntax-3/#consume-a-qualified-rule
Fixes https://github.com/dart-lang/csslib/issues/58.1 parent 5d0997f commit 33b1f2a
File tree
4 files changed
+47
-37
lines changed- lib
- src
- test
4 files changed
+47
-37
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1307 | 1307 | | |
1308 | 1308 | | |
1309 | 1309 | | |
| 1310 | + | |
1310 | 1311 | | |
1311 | 1312 | | |
1312 | 1313 | | |
1313 | 1314 | | |
1314 | 1315 | | |
1315 | 1316 | | |
| 1317 | + | |
1316 | 1318 | | |
1317 | 1319 | | |
1318 | 1320 | | |
| |||
1501 | 1503 | | |
1502 | 1504 | | |
1503 | 1505 | | |
1504 | | - | |
1505 | 1506 | | |
1506 | | - | |
1507 | | - | |
1508 | | - | |
1509 | | - | |
1510 | | - | |
1511 | | - | |
1512 | | - | |
1513 | | - | |
1514 | | - | |
1515 | | - | |
| 1507 | + | |
| 1508 | + | |
1516 | 1509 | | |
1517 | | - | |
| 1510 | + | |
1518 | 1511 | | |
1519 | 1512 | | |
1520 | 1513 | | |
1521 | | - | |
1522 | 1514 | | |
1523 | | - | |
| 1515 | + | |
1524 | 1516 | | |
1525 | | - | |
1526 | | - | |
1527 | | - | |
1528 | | - | |
1529 | | - | |
1530 | | - | |
| 1517 | + | |
1531 | 1518 | | |
1532 | | - | |
| 1519 | + | |
1533 | 1520 | | |
1534 | 1521 | | |
1535 | 1522 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
| |||
274 | 279 | | |
275 | 280 | | |
276 | 281 | | |
277 | | - | |
| 282 | + | |
278 | 283 | | |
279 | 284 | | |
280 | 285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | 146 | | |
152 | 147 | | |
153 | 148 | | |
154 | | - | |
| 149 | + | |
155 | 150 | | |
156 | | - | |
| 151 | + | |
157 | 152 | | |
158 | 153 | | |
159 | 154 | | |
160 | 155 | | |
161 | 156 | | |
162 | 157 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | 158 | | |
169 | 159 | | |
170 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
0 commit comments