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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 has_multiline_comment_before_next_; | 423 has_multiline_comment_before_next_; |
424 } | 424 } |
425 | 425 |
426 // Scans the input as a regular expression pattern, previous | 426 // Scans the input as a regular expression pattern, previous |
427 // character(s) must be /(=). Returns true if a pattern is scanned. | 427 // character(s) must be /(=). Returns true if a pattern is scanned. |
428 bool ScanRegExpPattern(bool seen_equal); | 428 bool ScanRegExpPattern(bool seen_equal); |
429 // Returns true if regexp flags are scanned (always since flags can | 429 // Returns true if regexp flags are scanned (always since flags can |
430 // be empty). | 430 // be empty). |
431 bool ScanRegExpFlags(); | 431 bool ScanRegExpFlags(); |
432 | 432 |
433 // Tells whether the buffer contains an identifier (no escapes). | |
434 // Used for checking if a property name is an identifier. | |
435 static bool IsIdentifier(unibrow::CharacterStream* buffer); | |
436 | |
437 private: | 433 private: |
438 // The current and look-ahead token. | 434 // The current and look-ahead token. |
439 struct TokenDesc { | 435 struct TokenDesc { |
440 Token::Value token; | 436 Token::Value token; |
441 Location location; | 437 Location location; |
442 LiteralBuffer* literal_chars; | 438 LiteralBuffer* literal_chars; |
443 }; | 439 }; |
444 | 440 |
445 // Call this after setting source_ to the input. | 441 // Call this after setting source_ to the input. |
446 void Init() { | 442 void Init() { |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 bool has_multiline_comment_before_next_; | 561 bool has_multiline_comment_before_next_; |
566 // Whether we scan 'let' as a keyword for harmony block-scoped let bindings. | 562 // Whether we scan 'let' as a keyword for harmony block-scoped let bindings. |
567 bool harmony_scoping_; | 563 bool harmony_scoping_; |
568 // Whether we scan 'module', 'import', 'export' as keywords. | 564 // Whether we scan 'module', 'import', 'export' as keywords. |
569 bool harmony_modules_; | 565 bool harmony_modules_; |
570 }; | 566 }; |
571 | 567 |
572 } } // namespace v8::internal | 568 } } // namespace v8::internal |
573 | 569 |
574 #endif // V8_SCANNER_H_ | 570 #endif // V8_SCANNER_H_ |
OLD | NEW |