| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 return current_literal_->utf16_string; | 156 return current_literal_->utf16_string; |
| 157 } | 157 } |
| 158 | 158 |
| 159 int literal_length() { | 159 int literal_length() { |
| 160 if (!current_literal_->Valid(current_.beg_pos)) { | 160 if (!current_literal_->Valid(current_.beg_pos)) { |
| 161 FillLiteral(current_, current_literal_); | 161 FillLiteral(current_, current_literal_); |
| 162 } | 162 } |
| 163 return current_literal_->length; | 163 return current_literal_->length; |
| 164 } | 164 } |
| 165 | 165 |
| 166 // This should be is_onebyte or is_latin1; it doesn't mean ASCII for real. |
| 166 bool is_literal_ascii() { | 167 bool is_literal_ascii() { |
| 167 if (!current_literal_->Valid(current_.beg_pos)) { | 168 if (!current_literal_->Valid(current_.beg_pos)) { |
| 168 FillLiteral(current_, current_literal_); | 169 FillLiteral(current_, current_literal_); |
| 169 } | 170 } |
| 170 return current_literal_->is_ascii; | 171 return current_literal_->is_ascii; |
| 171 } | 172 } |
| 172 | 173 |
| 173 bool is_literal_contextual_keyword(Vector<const char> keyword) { | 174 bool is_literal_contextual_keyword(Vector<const char> keyword) { |
| 174 if (!is_literal_ascii()) return false; | 175 if (!is_literal_ascii()) return false; |
| 175 Vector<const char> literal = literal_ascii_string(); | 176 Vector<const char> literal = literal_ascii_string(); |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 // character. | 603 // character. |
| 603 const Char* temp_cursor = last_octal_end_ - 1; | 604 const Char* temp_cursor = last_octal_end_ - 1; |
| 604 while (temp_cursor >= buffer_ && *temp_cursor >= '0' && *temp_cursor <= '7') | 605 while (temp_cursor >= buffer_ && *temp_cursor >= '0' && *temp_cursor <= '7') |
| 605 --temp_cursor; | 606 --temp_cursor; |
| 606 return Location(temp_cursor - buffer_ + 1, last_octal_end_ - buffer_); | 607 return Location(temp_cursor - buffer_ + 1, last_octal_end_ - buffer_); |
| 607 } | 608 } |
| 608 | 609 |
| 609 } } | 610 } } |
| 610 | 611 |
| 611 #endif // V8_LEXER_EXPERIMENTAL_SCANNER_H | 612 #endif // V8_LEXER_EXPERIMENTAL_SCANNER_H |
| OLD | NEW |