OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 } | 206 } |
207 | 207 |
208 static bool IsAssignmentOp(Value tok) { | 208 static bool IsAssignmentOp(Value tok) { |
209 return INIT_VAR <= tok && tok <= ASSIGN_MOD; | 209 return INIT_VAR <= tok && tok <= ASSIGN_MOD; |
210 } | 210 } |
211 | 211 |
212 static bool IsBinaryOp(Value op) { | 212 static bool IsBinaryOp(Value op) { |
213 return COMMA <= op && op <= MOD; | 213 return COMMA <= op && op <= MOD; |
214 } | 214 } |
215 | 215 |
| 216 static bool IsTruncatingBinaryOp(Value op) { |
| 217 return BIT_OR <= op && op <= ROR; |
| 218 } |
| 219 |
216 static bool IsCompareOp(Value op) { | 220 static bool IsCompareOp(Value op) { |
217 return EQ <= op && op <= IN; | 221 return EQ <= op && op <= IN; |
218 } | 222 } |
219 | 223 |
220 static bool IsOrderedRelationalCompareOp(Value op) { | 224 static bool IsOrderedRelationalCompareOp(Value op) { |
221 return op == LT || op == LTE || op == GT || op == GTE; | 225 return op == LT || op == LTE || op == GT || op == GTE; |
222 } | 226 } |
223 | 227 |
224 static bool IsEqualityOp(Value op) { | 228 static bool IsEqualityOp(Value op) { |
225 return op == EQ || op == EQ_STRICT; | 229 return op == EQ || op == EQ_STRICT; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 private: | 306 private: |
303 static const char* const name_[NUM_TOKENS]; | 307 static const char* const name_[NUM_TOKENS]; |
304 static const char* const string_[NUM_TOKENS]; | 308 static const char* const string_[NUM_TOKENS]; |
305 static const int8_t precedence_[NUM_TOKENS]; | 309 static const int8_t precedence_[NUM_TOKENS]; |
306 static const char token_type[NUM_TOKENS]; | 310 static const char token_type[NUM_TOKENS]; |
307 }; | 311 }; |
308 | 312 |
309 } } // namespace v8::internal | 313 } } // namespace v8::internal |
310 | 314 |
311 #endif // V8_TOKEN_H_ | 315 #endif // V8_TOKEN_H_ |
OLD | NEW |