| 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 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 * | 768 * |
| 769 * @mixin IDENT [(args,...)] '{' | 769 * @mixin IDENT [(args,...)] '{' |
| 770 * [ruleset | property | directive]* | 770 * [ruleset | property | directive]* |
| 771 * '}' | 771 * '}' |
| 772 */ | 772 */ |
| 773 MixinDefinition processMixin() { | 773 MixinDefinition processMixin() { |
| 774 _next(); | 774 _next(); |
| 775 | 775 |
| 776 var name = identifier(); | 776 var name = identifier(); |
| 777 | 777 |
| 778 var params = <VarDefinition>[]; | 778 var params = <TreeNode>[]; |
| 779 // Any parameters? | 779 // Any parameters? |
| 780 if (_maybeEat(TokenKind.LPAREN)) { | 780 if (_maybeEat(TokenKind.LPAREN)) { |
| 781 var mustHaveParam = false; | 781 var mustHaveParam = false; |
| 782 var keepGoing = true; | 782 var keepGoing = true; |
| 783 while (keepGoing) { | 783 while (keepGoing) { |
| 784 var varDef = processVariableOrDirective(mixinParameter: true); | 784 var varDef = processVariableOrDirective(mixinParameter: true); |
| 785 if (varDef is VarDefinitionDirective || varDef is VarDefinition) { | 785 if (varDef is VarDefinitionDirective || varDef is VarDefinition) { |
| 786 params.add(varDef); | 786 params.add(varDef); |
| 787 } else if (mustHaveParam) { | 787 } else if (mustHaveParam) { |
| 788 _warning("Expecting parameter", _makeSpan(_peekToken.span)); | 788 _warning("Expecting parameter", _makeSpan(_peekToken.span)); |
| (...skipping 1958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2747 | 2747 |
| 2748 if (replace != null && result == null) { | 2748 if (replace != null && result == null) { |
| 2749 result = new StringBuffer(text.substring(0, i)); | 2749 result = new StringBuffer(text.substring(0, i)); |
| 2750 } | 2750 } |
| 2751 | 2751 |
| 2752 if (result != null) result.write(replace != null ? replace : text[i]); | 2752 if (result != null) result.write(replace != null ? replace : text[i]); |
| 2753 } | 2753 } |
| 2754 | 2754 |
| 2755 return result == null ? text : result.toString(); | 2755 return result == null ? text : result.toString(); |
| 2756 } | 2756 } |
| OLD | NEW |