| 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 30 matching lines...) Expand all Loading... |
| 41 public: | 41 public: |
| 42 ParserBase(ScannerBase* scanner, uintptr_t stack_limit) | 42 ParserBase(ScannerBase* scanner, uintptr_t stack_limit) |
| 43 : scanner_(scanner), | 43 : scanner_(scanner), |
| 44 stack_limit_(stack_limit), | 44 stack_limit_(stack_limit), |
| 45 stack_overflow_(false), | 45 stack_overflow_(false), |
| 46 allow_lazy_(false), | 46 allow_lazy_(false), |
| 47 allow_natives_syntax_(false), | 47 allow_natives_syntax_(false), |
| 48 allow_generators_(false), | 48 allow_generators_(false), |
| 49 allow_for_of_(false) { } | 49 allow_for_of_(false) { } |
| 50 // TODO(mstarzinger): Only virtual until message reporting has been unified. | 50 // TODO(mstarzinger): Only virtual until message reporting has been unified. |
| 51 virtual ~ParserBase() { } | 51 // FIXME: Might need to continue to be virtual for the experimental branch. |
| 52 virtual ~ParserBase() { |
| 53 delete scanner_; |
| 54 scanner_ = NULL; |
| 55 } |
| 52 | 56 |
| 53 // Getters that indicate whether certain syntactical constructs are | 57 // Getters that indicate whether certain syntactical constructs are |
| 54 // allowed to be parsed by this instance of the parser. | 58 // allowed to be parsed by this instance of the parser. |
| 55 bool allow_lazy() const { return allow_lazy_; } | 59 bool allow_lazy() const { return allow_lazy_; } |
| 56 bool allow_natives_syntax() const { return allow_natives_syntax_; } | 60 bool allow_natives_syntax() const { return allow_natives_syntax_; } |
| 57 bool allow_generators() const { return allow_generators_; } | 61 bool allow_generators() const { return allow_generators_; } |
| 58 bool allow_for_of() const { return allow_for_of_; } | 62 bool allow_for_of() const { return allow_for_of_; } |
| 59 bool allow_modules() const { return scanner()->HarmonyModules(); } | 63 bool allow_modules() const { return scanner()->HarmonyModules(); } |
| 60 bool allow_harmony_scoping() const { return scanner()->HarmonyScoping(); } | 64 bool allow_harmony_scoping() const { return scanner()->HarmonyScoping(); } |
| 61 bool allow_harmony_numeric_literals() const { | 65 bool allow_harmony_numeric_literals() const { |
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 ParserRecorder* log_; | 689 ParserRecorder* log_; |
| 686 Scope* scope_; | 690 Scope* scope_; |
| 687 ScannerBase::Location strict_mode_violation_location_; | 691 ScannerBase::Location strict_mode_violation_location_; |
| 688 const char* strict_mode_violation_type_; | 692 const char* strict_mode_violation_type_; |
| 689 bool parenthesized_function_; | 693 bool parenthesized_function_; |
| 690 }; | 694 }; |
| 691 | 695 |
| 692 } } // v8::internal | 696 } } // v8::internal |
| 693 | 697 |
| 694 #endif // V8_PREPARSER_H | 698 #endif // V8_PREPARSER_H |
| OLD | NEW |