| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 return literal.length() == keyword.length() && | 231 return literal.length() == keyword.length() && |
| 232 (memcmp(literal.start(), keyword.start(), literal.length()) == 0); | 232 (memcmp(literal.start(), keyword.start(), literal.length()) == 0); |
| 233 } | 233 } |
| 234 | 234 |
| 235 protected: | 235 protected: |
| 236 struct TokenDesc { | 236 struct TokenDesc { |
| 237 Token::Value token; | 237 Token::Value token; |
| 238 int beg_pos; | 238 int beg_pos; |
| 239 int end_pos; | 239 int end_pos; |
| 240 bool has_escapes; | 240 bool has_escapes; |
| 241 bool is_onebyte; |
| 241 }; | 242 }; |
| 242 | 243 |
| 243 struct LiteralDesc { | 244 struct LiteralDesc { |
| 244 int beg_pos; | 245 int beg_pos; |
| 245 bool is_ascii; | 246 bool is_ascii; |
| 246 int length; | 247 int length; |
| 247 Vector<const char> ascii_string; | 248 Vector<const char> ascii_string; |
| 248 Vector<const uc16> utf16_string; | 249 Vector<const uc16> utf16_string; |
| 249 LiteralBuffer buffer; | 250 LiteralBuffer buffer; |
| 250 LiteralDesc() : beg_pos(-1), is_ascii(false), length(0) { } | 251 LiteralDesc() : beg_pos(-1), is_ascii(false), length(0) { } |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 // character. | 607 // character. |
| 607 const Char* temp_cursor = last_octal_end_ - 1; | 608 const Char* temp_cursor = last_octal_end_ - 1; |
| 608 while (temp_cursor >= buffer_ && *temp_cursor >= '0' && *temp_cursor <= '7') | 609 while (temp_cursor >= buffer_ && *temp_cursor >= '0' && *temp_cursor <= '7') |
| 609 --temp_cursor; | 610 --temp_cursor; |
| 610 return Location(temp_cursor - buffer_ + 1, last_octal_end_ - buffer_); | 611 return Location(temp_cursor - buffer_ + 1, last_octal_end_ - buffer_); |
| 611 } | 612 } |
| 612 | 613 |
| 613 } } | 614 } } |
| 614 | 615 |
| 615 #endif // V8_LEXER_EXPERIMENTAL_SCANNER_H | 616 #endif // V8_LEXER_EXPERIMENTAL_SCANNER_H |
| OLD | NEW |