OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library csslib.parser; | 5 library csslib.parser; |
6 | 6 |
7 import 'dart:math' as math; | 7 import 'dart:math' as math; |
8 | 8 |
9 import 'package:source_span/source_span.dart'; | 9 import 'package:source_span/source_span.dart'; |
10 | 10 |
(...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1288 * namespace_prefix | 1288 * namespace_prefix |
1289 * : [ IDENT | '*' ]? '|' | 1289 * : [ IDENT | '*' ]? '|' |
1290 * element_name | 1290 * element_name |
1291 * : IDENT | 1291 * : IDENT |
1292 * universal | 1292 * universal |
1293 * : [ namespace_prefix ]? '*' | 1293 * : [ namespace_prefix ]? '*' |
1294 * class | 1294 * class |
1295 * : '.' IDENT | 1295 * : '.' IDENT |
1296 */ | 1296 */ |
1297 simpleSelector() { | 1297 simpleSelector() { |
1298 // TODO(terry): Nathan makes a good point parsing of namespace and element | 1298 // TODO(terry): Natalie makes a good point parsing of namespace and element |
1299 // are essentially the same (asterisk or identifier) other | 1299 // are essentially the same (asterisk or identifier) other |
1300 // than the error message for element. Should consolidate the | 1300 // than the error message for element. Should consolidate the |
1301 // code. | 1301 // code. |
1302 // TODO(terry): Need to handle attribute namespace too. | 1302 // TODO(terry): Need to handle attribute namespace too. |
1303 var first; | 1303 var first; |
1304 int start = _peekToken.start; | 1304 int start = _peekToken.start; |
1305 switch (_peek()) { | 1305 switch (_peek()) { |
1306 case TokenKind.ASTERISK: | 1306 case TokenKind.ASTERISK: |
1307 // Mark as universal namespace. | 1307 // Mark as universal namespace. |
1308 var tok = _next(); | 1308 var tok = _next(); |
(...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2695 | 2695 |
2696 if (replace != null && result == null) { | 2696 if (replace != null && result == null) { |
2697 result = new StringBuffer(text.substring(0, i)); | 2697 result = new StringBuffer(text.substring(0, i)); |
2698 } | 2698 } |
2699 | 2699 |
2700 if (result != null) result.write(replace != null ? replace : text[i]); | 2700 if (result != null) result.write(replace != null ? replace : text[i]); |
2701 } | 2701 } |
2702 | 2702 |
2703 return result == null ? text : result.toString(); | 2703 return result == null ? text : result.toString(); |
2704 } | 2704 } |
OLD | NEW |