Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(518)

Side by Side Diff: pkg/analyzer/lib/src/generated/constant.dart

Issue 184893003: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.constant; 8 library engine.constant;
9 9
10 import 'java_core.dart'; 10 import 'java_core.dart';
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 } else if (operatorType == TokenType.PERCENT) { 510 } else if (operatorType == TokenType.PERCENT) {
511 return leftResult.remainder(_typeProvider, node, rightResult); 511 return leftResult.remainder(_typeProvider, node, rightResult);
512 } else if (operatorType == TokenType.PLUS) { 512 } else if (operatorType == TokenType.PLUS) {
513 return leftResult.add(_typeProvider, node, rightResult); 513 return leftResult.add(_typeProvider, node, rightResult);
514 } else if (operatorType == TokenType.STAR) { 514 } else if (operatorType == TokenType.STAR) {
515 return leftResult.times(_typeProvider, node, rightResult); 515 return leftResult.times(_typeProvider, node, rightResult);
516 } else if (operatorType == TokenType.SLASH) { 516 } else if (operatorType == TokenType.SLASH) {
517 return leftResult.divide(_typeProvider, node, rightResult); 517 return leftResult.divide(_typeProvider, node, rightResult);
518 } else if (operatorType == TokenType.TILDE_SLASH) { 518 } else if (operatorType == TokenType.TILDE_SLASH) {
519 return leftResult.integerDivide(_typeProvider, node, rightResult); 519 return leftResult.integerDivide(_typeProvider, node, rightResult);
520 } else {
521 // TODO(brianwilkerson) Figure out which error to report.
522 return error(node, null);
520 } 523 }
521 break; 524 break;
522 } 525 }
523 // TODO(brianwilkerson) Figure out which error to report.
524 return error(node, null);
525 } 526 }
526 527
527 EvaluationResultImpl visitBooleanLiteral(BooleanLiteral node) => valid2(_typeP rovider.boolType, BoolState.from(node.value)); 528 EvaluationResultImpl visitBooleanLiteral(BooleanLiteral node) => valid2(_typeP rovider.boolType, BoolState.from(node.value));
528 529
529 EvaluationResultImpl visitConditionalExpression(ConditionalExpression node) { 530 EvaluationResultImpl visitConditionalExpression(ConditionalExpression node) {
530 Expression condition = node.condition; 531 Expression condition = node.condition;
531 EvaluationResultImpl conditionResult = condition.accept(this); 532 EvaluationResultImpl conditionResult = condition.accept(this);
532 EvaluationResultImpl thenResult = node.thenExpression.accept(this); 533 EvaluationResultImpl thenResult = node.thenExpression.accept(this);
533 EvaluationResultImpl elseResult = node.elseExpression.accept(this); 534 EvaluationResultImpl elseResult = node.elseExpression.accept(this);
534 if (conditionResult is ErrorResult) { 535 if (conditionResult is ErrorResult) {
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 if (operand is ValidResult && operand.isNull) { 718 if (operand is ValidResult && operand.isNull) {
718 return error(node, CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); 719 return error(node, CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
719 } 720 }
720 while (true) { 721 while (true) {
721 if (node.operator.type == TokenType.BANG) { 722 if (node.operator.type == TokenType.BANG) {
722 return operand.logicalNot(_typeProvider, node); 723 return operand.logicalNot(_typeProvider, node);
723 } else if (node.operator.type == TokenType.TILDE) { 724 } else if (node.operator.type == TokenType.TILDE) {
724 return operand.bitNot(_typeProvider, node); 725 return operand.bitNot(_typeProvider, node);
725 } else if (node.operator.type == TokenType.MINUS) { 726 } else if (node.operator.type == TokenType.MINUS) {
726 return operand.negated(_typeProvider, node); 727 return operand.negated(_typeProvider, node);
728 } else {
729 // TODO(brianwilkerson) Figure out which error to report.
730 return error(node, null);
727 } 731 }
728 break; 732 break;
729 } 733 }
730 // TODO(brianwilkerson) Figure out which error to report.
731 return error(node, null);
732 } 734 }
733 735
734 EvaluationResultImpl visitPropertyAccess(PropertyAccess node) => getConstantVa lue(node, node.propertyName.staticElement); 736 EvaluationResultImpl visitPropertyAccess(PropertyAccess node) => getConstantVa lue(node, node.propertyName.staticElement);
735 737
736 EvaluationResultImpl visitSimpleIdentifier(SimpleIdentifier node) => getConsta ntValue(node, node.staticElement); 738 EvaluationResultImpl visitSimpleIdentifier(SimpleIdentifier node) => getConsta ntValue(node, node.staticElement);
737 739
738 EvaluationResultImpl visitSimpleStringLiteral(SimpleStringLiteral node) => val id2(_typeProvider.stringType, new StringState(node.value)); 740 EvaluationResultImpl visitSimpleStringLiteral(SimpleStringLiteral node) => val id2(_typeProvider.stringType, new StringState(node.value));
739 741
740 EvaluationResultImpl visitStringInterpolation(StringInterpolation node) { 742 EvaluationResultImpl visitStringInterpolation(StringInterpolation node) {
741 EvaluationResultImpl result = null; 743 EvaluationResultImpl result = null;
(...skipping 3444 matching lines...) Expand 10 before | Expand all | Expand 10 after
4186 } 4188 }
4187 return BoolState.FALSE_STATE; 4189 return BoolState.FALSE_STATE;
4188 } 4190 }
4189 4191
4190 String get typeName => "Type"; 4192 String get typeName => "Type";
4191 4193
4192 int get hashCode => _element == null ? 0 : _element.hashCode; 4194 int get hashCode => _element == null ? 0 : _element.hashCode;
4193 4195
4194 String toString() => _element == null ? "-unknown-" : _element.name; 4196 String toString() => _element == null ? "-unknown-" : _element.name;
4195 } 4197 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698