| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 void set_allow_for_of(bool allow) { allow_for_of_ = allow; } | 69 void set_allow_for_of(bool allow) { allow_for_of_ = allow; } |
| 70 void set_allow_modules(bool allow) { scanner()->SetHarmonyModules(allow); } | 70 void set_allow_modules(bool allow) { scanner()->SetHarmonyModules(allow); } |
| 71 void set_allow_harmony_scoping(bool allow) { | 71 void set_allow_harmony_scoping(bool allow) { |
| 72 scanner()->SetHarmonyScoping(allow); | 72 scanner()->SetHarmonyScoping(allow); |
| 73 } | 73 } |
| 74 void set_allow_harmony_numeric_literals(bool allow) { | 74 void set_allow_harmony_numeric_literals(bool allow) { |
| 75 scanner()->SetHarmonyNumericLiterals(allow); | 75 scanner()->SetHarmonyNumericLiterals(allow); |
| 76 } | 76 } |
| 77 | 77 |
| 78 protected: | 78 protected: |
| 79 enum AllowEvalOrArgumentsAsIdentifier { |
| 80 kAllowEvalOrArguments, |
| 81 kDontAllowEvalOrArguments |
| 82 }; |
| 83 |
| 79 Scanner* scanner() const { return scanner_; } | 84 Scanner* scanner() const { return scanner_; } |
| 80 int position() { return scanner_->location().beg_pos; } | 85 int position() { return scanner_->location().beg_pos; } |
| 81 int peek_position() { return scanner_->peek_location().beg_pos; } | 86 int peek_position() { return scanner_->peek_location().beg_pos; } |
| 82 bool stack_overflow() const { return stack_overflow_; } | 87 bool stack_overflow() const { return stack_overflow_; } |
| 83 void set_stack_overflow() { stack_overflow_ = true; } | 88 void set_stack_overflow() { stack_overflow_ = true; } |
| 84 | 89 |
| 85 INLINE(Token::Value peek()) { | 90 INLINE(Token::Value peek()) { |
| 86 if (stack_overflow_) return Token::ILLEGAL; | 91 if (stack_overflow_) return Token::ILLEGAL; |
| 87 return scanner()->peek(); | 92 return scanner()->peek(); |
| 88 } | 93 } |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 Expression ParsePrimaryExpression(bool* ok); | 638 Expression ParsePrimaryExpression(bool* ok); |
| 634 Expression ParseArrayLiteral(bool* ok); | 639 Expression ParseArrayLiteral(bool* ok); |
| 635 Expression ParseObjectLiteral(bool* ok); | 640 Expression ParseObjectLiteral(bool* ok); |
| 636 Expression ParseRegExpLiteral(bool seen_equal, bool* ok); | 641 Expression ParseRegExpLiteral(bool seen_equal, bool* ok); |
| 637 Expression ParseV8Intrinsic(bool* ok); | 642 Expression ParseV8Intrinsic(bool* ok); |
| 638 | 643 |
| 639 Arguments ParseArguments(bool* ok); | 644 Arguments ParseArguments(bool* ok); |
| 640 Expression ParseFunctionLiteral(bool is_generator, bool* ok); | 645 Expression ParseFunctionLiteral(bool is_generator, bool* ok); |
| 641 void ParseLazyFunctionLiteralBody(bool* ok); | 646 void ParseLazyFunctionLiteralBody(bool* ok); |
| 642 | 647 |
| 643 Identifier ParseIdentifier(bool* ok); | 648 Identifier ParseIdentifier(AllowEvalOrArgumentsAsIdentifier, bool* ok); |
| 644 Identifier ParseIdentifierName(bool* ok); | 649 Identifier ParseIdentifierName(bool* ok); |
| 645 Identifier ParseIdentifierNameOrGetOrSet(bool* is_get, | 650 Identifier ParseIdentifierNameOrGetOrSet(bool* is_get, |
| 646 bool* is_set, | 651 bool* is_set, |
| 647 bool* ok); | 652 bool* ok); |
| 648 | 653 |
| 649 // Logs the currently parsed literal as a symbol in the preparser data. | 654 // Logs the currently parsed literal as a symbol in the preparser data. |
| 650 void LogSymbol(); | 655 void LogSymbol(); |
| 651 // Log the currently parsed identifier. | 656 // Log the currently parsed identifier. |
| 652 Identifier GetIdentifierSymbol(); | 657 Identifier GetIdentifierSymbol(); |
| 653 // Log the currently parsed string literal. | 658 // Log the currently parsed string literal. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 683 ParserRecorder* log_; | 688 ParserRecorder* log_; |
| 684 Scope* scope_; | 689 Scope* scope_; |
| 685 Scanner::Location strict_mode_violation_location_; | 690 Scanner::Location strict_mode_violation_location_; |
| 686 const char* strict_mode_violation_type_; | 691 const char* strict_mode_violation_type_; |
| 687 bool parenthesized_function_; | 692 bool parenthesized_function_; |
| 688 }; | 693 }; |
| 689 | 694 |
| 690 } } // v8::internal | 695 } } // v8::internal |
| 691 | 696 |
| 692 #endif // V8_PREPARSER_H | 697 #endif // V8_PREPARSER_H |
| OLD | NEW |