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