OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 // The current and look-ahead token. | 355 // The current and look-ahead token. |
356 struct TokenDesc { | 356 struct TokenDesc { |
357 Token::Value token; | 357 Token::Value token; |
358 Location location; | 358 Location location; |
359 LiteralBuffer* literal_chars; | 359 LiteralBuffer* literal_chars; |
360 }; | 360 }; |
361 | 361 |
362 // Call this after setting source_ to the input. | 362 // Call this after setting source_ to the input. |
363 void Init() { | 363 void Init() { |
364 // Set c0_ (one character ahead) | 364 // Set c0_ (one character ahead) |
365 ASSERT(kCharacterLookaheadBufferSize == 1); | 365 STATIC_ASSERT(kCharacterLookaheadBufferSize == 1); |
366 Advance(); | 366 Advance(); |
367 // Initialize current_ to not refer to a literal. | 367 // Initialize current_ to not refer to a literal. |
368 current_.literal_chars = NULL; | 368 current_.literal_chars = NULL; |
369 } | 369 } |
370 | 370 |
371 // Literal buffer support | 371 // Literal buffer support |
372 inline void StartLiteral() { | 372 inline void StartLiteral() { |
373 LiteralBuffer* free_buffer = (current_.literal_chars == &literal_buffer1_) ? | 373 LiteralBuffer* free_buffer = (current_.literal_chars == &literal_buffer1_) ? |
374 &literal_buffer2_ : &literal_buffer1_; | 374 &literal_buffer2_ : &literal_buffer1_; |
375 free_buffer->Reset(); | 375 free_buffer->Reset(); |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 // line-terminator after the current token, and before the next. | 553 // line-terminator after the current token, and before the next. |
554 bool has_multiline_comment_before_next_; | 554 bool has_multiline_comment_before_next_; |
555 // Whether we scan 'let' as a keyword for harmony block scoped | 555 // Whether we scan 'let' as a keyword for harmony block scoped |
556 // let bindings. | 556 // let bindings. |
557 bool harmony_block_scoping_; | 557 bool harmony_block_scoping_; |
558 }; | 558 }; |
559 | 559 |
560 } } // namespace v8::internal | 560 } } // namespace v8::internal |
561 | 561 |
562 #endif // V8_SCANNER_BASE_H_ | 562 #endif // V8_SCANNER_BASE_H_ |
OLD | NEW |