UnaryOperatorExpression -> UnaryOperationExpression

This commit is contained in:
Natalie Weizenbaum 2016-09-11 14:42:52 -07:00 committed by Natalie Weizenbaum
parent 5d71ac78b9
commit bcaaa1103f
6 changed files with 14 additions and 14 deletions

View File

@ -18,7 +18,7 @@ export 'sass/expression/null.dart';
export 'sass/expression/number.dart';
export 'sass/expression/selector.dart';
export 'sass/expression/string.dart';
export 'sass/expression/unary_operator.dart';
export 'sass/expression/unary_operation.dart';
export 'sass/expression/variable.dart';
export 'sass/interpolation.dart';
export 'sass/media_query.dart';

View File

@ -9,7 +9,7 @@ import '../../../utils.dart';
import '../../../value.dart';
import '../../../visitor/interface/expression.dart';
import '../expression.dart';
import 'unary_operator.dart';
import 'unary_operation.dart';
class ListExpression implements Expression {
final List<Expression> contents;
@ -54,7 +54,7 @@ class ListExpression implements Expression {
if (separator != ListSeparator.space) return false;
if (expression is UnaryOperatorExpression) {
if (expression is UnaryOperationExpression) {
return expression.operator == UnaryOperator.plus ||
expression.operator == UnaryOperator.minus;
}

View File

@ -8,17 +8,17 @@ import 'package:charcode/charcode.dart';
import '../../../visitor/interface/expression.dart';
import '../expression.dart';
class UnaryOperatorExpression implements Expression {
class UnaryOperationExpression implements Expression {
final UnaryOperator operator;
final Expression operand;
final FileSpan span;
UnaryOperatorExpression(this.operator, this.operand, this.span);
UnaryOperationExpression(this.operator, this.operand, this.span);
/*=T*/ accept/*<T>*/(ExpressionVisitor/*<T>*/ visitor) =>
visitor.visitUnaryOperatorExpression(this);
visitor.visitUnaryOperationExpression(this);
String toString() {
var buffer = new StringBuffer(operator.operator);

View File

@ -773,7 +773,7 @@ abstract class StylesheetParser extends Parser {
case $lparen:
return _parentheses();
case $slash:
return _unaryOperator();
return _unaryOperation();
case $dot:
return _number();
case $lbracket:
@ -795,14 +795,14 @@ abstract class StylesheetParser extends Parser {
var next = scanner.peekChar(1);
if (isDigit(next) || next == $dot) return _number();
return _unaryOperator();
return _unaryOperation();
case $minus:
var next = scanner.peekChar(1);
if (isDigit(next) || next == $dot) return _number();
if (_lookingAtInterpolatedIdentifier()) return _identifierLike();
return _unaryOperator();
return _unaryOperation();
default:
if (first == null) scanner.error("Expected expression.");
@ -870,7 +870,7 @@ abstract class StylesheetParser extends Parser {
return new MapExpression(pairs, scanner.spanFrom(start));
}
UnaryOperatorExpression _unaryOperator() {
UnaryOperationExpression _unaryOperation() {
var start = scanner.state;
var operator = _unaryOperatorFor(scanner.readChar());
if (operator == null) {
@ -879,7 +879,7 @@ abstract class StylesheetParser extends Parser {
whitespace();
var operand = _singleExpression();
return new UnaryOperatorExpression(
return new UnaryOperationExpression(
operator, operand, scanner.spanFrom(start));
}
@ -1054,7 +1054,7 @@ abstract class StylesheetParser extends Parser {
switch (identifier.asPlain) {
case "not":
whitespace();
return new UnaryOperatorExpression(
return new UnaryOperationExpression(
UnaryOperator.not, _singleExpression(), identifier.span);
case "null":

View File

@ -15,6 +15,6 @@ abstract class ExpressionVisitor<T> {
T visitNumberExpression(NumberExpression node);
T visitSelectorExpression(SelectorExpression node);
T visitStringExpression(StringExpression node);
T visitUnaryOperatorExpression(UnaryOperatorExpression node);
T visitUnaryOperationExpression(UnaryOperationExpression node);
T visitVariableExpression(VariableExpression node);
}

View File

@ -576,7 +576,7 @@ class PerformVisitor implements StatementVisitor, ExpressionVisitor<Value> {
throw _exception("Undefined variable.", node.span);
}
Value visitUnaryOperatorExpression(UnaryOperatorExpression node) {
Value visitUnaryOperationExpression(UnaryOperationExpression node) {
var operand = node.operand.accept(this);
switch (node.operator) {
case UnaryOperator.plus: