| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #include "vm/token.h" | 5 #include "vm/token.h" |
| 6 | 6 |
| 7 #include "vm/object.h" | 7 #include "vm/object.h" |
| 8 | 8 |
| 9 namespace dart { | 9 namespace dart { |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 | 39 |
| 40 bool Token::IsBinaryOperator(Token::Kind token) { | 40 bool Token::IsBinaryOperator(Token::Kind token) { |
| 41 switch (token) { | 41 switch (token) { |
| 42 case Token::kADD: | 42 case Token::kADD: |
| 43 case Token::kSUB: | 43 case Token::kSUB: |
| 44 case Token::kMUL: | 44 case Token::kMUL: |
| 45 case Token::kDIV: | 45 case Token::kDIV: |
| 46 case Token::kTRUNCDIV: | 46 case Token::kTRUNCDIV: |
| 47 case Token::kMOD: | 47 case Token::kMOD: |
| 48 case Token::kTRUNCDIVMOD: |
| 49 case Token::kREM: |
| 50 case Token::kTRUNCDIVREM: |
| 48 case Token::kBIT_OR: | 51 case Token::kBIT_OR: |
| 49 case Token::kBIT_XOR: | 52 case Token::kBIT_XOR: |
| 50 case Token::kBIT_AND: | 53 case Token::kBIT_AND: |
| 51 case Token::kOR: | 54 case Token::kOR: |
| 52 case Token::kAND: | 55 case Token::kAND: |
| 53 case Token::kSHL: | 56 case Token::kSHL: |
| 54 case Token::kSHR: | 57 case Token::kSHR: |
| 55 return true; | 58 return true; |
| 56 default: | 59 default: |
| 57 return false; | 60 return false; |
| 58 } | 61 } |
| 59 } | 62 } |
| 60 | 63 |
| 61 | 64 |
| 62 bool Token::IsPrefixOperator(Token::Kind token) { | 65 bool Token::IsPrefixOperator(Token::Kind token) { |
| 63 return (token == kNOT) || (token == kBIT_NOT) || (token == kNEGATE); | 66 return (token == kNOT) || (token == kBIT_NOT) || (token == kNEGATE); |
| 64 } | 67 } |
| 65 | 68 |
| 66 } // namespace dart | 69 } // namespace dart |
| OLD | NEW |