OLD | NEW |
1 // Copyright 2011 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 } | 208 } |
209 | 209 |
210 static bool IsBinaryOp(Value op) { | 210 static bool IsBinaryOp(Value op) { |
211 return COMMA <= op && op <= MOD; | 211 return COMMA <= op && op <= MOD; |
212 } | 212 } |
213 | 213 |
214 static bool IsCompareOp(Value op) { | 214 static bool IsCompareOp(Value op) { |
215 return EQ <= op && op <= IN; | 215 return EQ <= op && op <= IN; |
216 } | 216 } |
217 | 217 |
218 static bool IsOrderedCompareOp(Value op) { | 218 static bool IsOrderedRelationalCompareOp(Value op) { |
219 return op == LT || op == LTE || op == GT || op == GTE; | 219 return op == LT || op == LTE || op == GT || op == GTE; |
220 } | 220 } |
221 | 221 |
222 static bool IsEqualityOp(Value op) { | 222 static bool IsEqualityOp(Value op) { |
223 return op == EQ || op == EQ_STRICT; | 223 return op == EQ || op == EQ_STRICT; |
224 } | 224 } |
225 | 225 |
226 static Value NegateCompareOp(Value op) { | 226 static Value NegateCompareOp(Value op) { |
227 ASSERT(IsCompareOp(op)); | 227 ASSERT(IsCompareOp(op)); |
228 switch (op) { | 228 switch (op) { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 private: | 287 private: |
288 static const char* const name_[NUM_TOKENS]; | 288 static const char* const name_[NUM_TOKENS]; |
289 static const char* const string_[NUM_TOKENS]; | 289 static const char* const string_[NUM_TOKENS]; |
290 static const int8_t precedence_[NUM_TOKENS]; | 290 static const int8_t precedence_[NUM_TOKENS]; |
291 static const char token_type[NUM_TOKENS]; | 291 static const char token_type[NUM_TOKENS]; |
292 }; | 292 }; |
293 | 293 |
294 } } // namespace v8::internal | 294 } } // namespace v8::internal |
295 | 295 |
296 #endif // V8_TOKEN_H_ | 296 #endif // V8_TOKEN_H_ |
OLD | NEW |