| 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 bool has_escapes; | 245 bool has_escapes; |
| 246 }; | 246 }; |
| 247 | 247 |
| 248 struct LiteralDesc { | 248 struct LiteralDesc { |
| 249 int beg_pos; | 249 int beg_pos; |
| 250 bool is_ascii; | 250 bool is_ascii; |
| 251 int length; | 251 int length; |
| 252 Vector<const char> ascii_string; | 252 Vector<const char> ascii_string; |
| 253 Vector<const uc16> utf16_string; | 253 Vector<const uc16> utf16_string; |
| 254 LiteralBuffer buffer; | 254 LiteralBuffer buffer; |
| 255 LiteralDesc() : beg_pos(-1), is_ascii(false), length(0) { } |
| 255 bool Valid(int pos) { return beg_pos == pos; } | 256 bool Valid(int pos) { return beg_pos == pos; } |
| 256 }; | 257 }; |
| 257 | 258 |
| 258 virtual void Scan() = 0; | 259 virtual void Scan() = 0; |
| 259 virtual void SetBufferBasedOnHandle() = 0; | 260 virtual void SetBufferBasedOnHandle() = 0; |
| 260 | 261 |
| 261 static void UpdateBuffersAfterGC(v8::Isolate*, GCType, GCCallbackFlags); | 262 static void UpdateBuffersAfterGC(v8::Isolate*, GCType, GCCallbackFlags); |
| 262 virtual bool FillLiteral(const TokenDesc& token, LiteralDesc* literal) = 0; | 263 virtual bool FillLiteral(const TokenDesc& token, LiteralDesc* literal) = 0; |
| 263 | 264 |
| 264 Isolate* isolate_; | 265 Isolate* isolate_; |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 // character. | 604 // character. |
| 604 const Char* temp_cursor = last_octal_end_ - 1; | 605 const Char* temp_cursor = last_octal_end_ - 1; |
| 605 while (temp_cursor >= buffer_ && *temp_cursor >= '0' && *temp_cursor <= '7') | 606 while (temp_cursor >= buffer_ && *temp_cursor >= '0' && *temp_cursor <= '7') |
| 606 --temp_cursor; | 607 --temp_cursor; |
| 607 return Location(temp_cursor - buffer_ + 1, last_octal_end_ - buffer_); | 608 return Location(temp_cursor - buffer_ + 1, last_octal_end_ - buffer_); |
| 608 } | 609 } |
| 609 | 610 |
| 610 } } | 611 } } |
| 611 | 612 |
| 612 #endif // V8_LEXER_EXPERIMENTAL_SCANNER_H | 613 #endif // V8_LEXER_EXPERIMENTAL_SCANNER_H |
| OLD | NEW |