Chromium Code Reviews| 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 abstract class ConstantVisitor<R> { | 5 abstract class ConstantVisitor<R> { |
| 6 R visitSentinel(SentinelConstant constant); | 6 R visitSentinel(SentinelConstant constant); |
| 7 R visitFunction(FunctionConstant constant); | 7 R visitFunction(FunctionConstant constant); |
| 8 R visitNull(NullConstant constant); | 8 R visitNull(NullConstant constant); |
| 9 R visitInt(IntConstant constant); | 9 R visitInt(IntConstant constant); |
| 10 R visitDouble(DoubleConstant constant); | 10 R visitDouble(DoubleConstant constant); |
| 11 R visitTrue(TrueConstant constant); | 11 R visitTrue(TrueConstant constant); |
| 12 R visitFalse(FalseConstant constant); | 12 R visitFalse(FalseConstant constant); |
| 13 R visitString(StringConstant constant); | 13 R visitString(StringConstant constant); |
| 14 R visitList(ListConstant constant); | 14 R visitList(ListConstant constant); |
| 15 R visitMap(MapConstant constant); | 15 R visitMap(MapConstant constant); |
| 16 R visitConstructed(ConstructedConstant constant); | 16 R visitConstructed(ConstructedConstant constant); |
| 17 } | 17 } |
| 18 | 18 |
| 19 class Constant implements Hashable { | 19 class Constant { |
|
Lasse Reichstein Nielsen
2012/09/27 12:42:36
Whoops, double space. Will fix.
Mads Ager (google)
2012/09/27 12:48:27
Remove extra space before '{'.
| |
| 20 const Constant(); | 20 const Constant(); |
| 21 | 21 |
| 22 bool isNull() => false; | 22 bool isNull() => false; |
| 23 bool isBool() => false; | 23 bool isBool() => false; |
| 24 bool isTrue() => false; | 24 bool isTrue() => false; |
| 25 bool isFalse() => false; | 25 bool isFalse() => false; |
| 26 bool isInt() => false; | 26 bool isInt() => false; |
| 27 bool isDouble() => false; | 27 bool isDouble() => false; |
| 28 bool isNum() => false; | 28 bool isNum() => false; |
| 29 bool isString() => false; | 29 bool isString() => false; |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 434 if (fields[i] != other.fields[i]) return false; | 434 if (fields[i] != other.fields[i]) return false; |
| 435 } | 435 } |
| 436 return true; | 436 return true; |
| 437 } | 437 } |
| 438 | 438 |
| 439 int hashCode() => _hashCode; | 439 int hashCode() => _hashCode; |
| 440 List<Constant> getDependencies() => fields; | 440 List<Constant> getDependencies() => fields; |
| 441 | 441 |
| 442 accept(ConstantVisitor visitor) => visitor.visitConstructed(this); | 442 accept(ConstantVisitor visitor) => visitor.visitConstructed(this); |
| 443 } | 443 } |
| OLD | NEW |