| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 // Report syntax error | 463 // Report syntax error |
| 464 void ReportUnexpectedToken(Token::Value token); | 464 void ReportUnexpectedToken(Token::Value token); |
| 465 void ReportInvalidPreparseData(Handle<String> name, bool* ok); | 465 void ReportInvalidPreparseData(Handle<String> name, bool* ok); |
| 466 void ReportMessage(const char* message, Vector<const char*> args); | 466 void ReportMessage(const char* message, Vector<const char*> args); |
| 467 | 467 |
| 468 bool inside_with() const { return with_nesting_level_ > 0; } | 468 bool inside_with() const { return with_nesting_level_ > 0; } |
| 469 V8JavaScriptScanner& scanner() { return scanner_; } | 469 V8JavaScriptScanner& scanner() { return scanner_; } |
| 470 Mode mode() const { return mode_; } | 470 Mode mode() const { return mode_; } |
| 471 ScriptDataImpl* pre_data() const { return pre_data_; } | 471 ScriptDataImpl* pre_data() const { return pre_data_; } |
| 472 | 472 |
| 473 // Check if the given string is 'eval' or 'arguments'. |
| 474 bool IsEvalOrArguments(Handle<String> string); |
| 475 |
| 473 // All ParseXXX functions take as the last argument an *ok parameter | 476 // All ParseXXX functions take as the last argument an *ok parameter |
| 474 // which is set to false if parsing failed; it is unchanged otherwise. | 477 // which is set to false if parsing failed; it is unchanged otherwise. |
| 475 // By making the 'exception handling' explicit, we are forced to check | 478 // By making the 'exception handling' explicit, we are forced to check |
| 476 // for failure at the call sites. | 479 // for failure at the call sites. |
| 477 void* ParseSourceElements(ZoneList<Statement*>* processor, | 480 void* ParseSourceElements(ZoneList<Statement*>* processor, |
| 478 int end_token, bool* ok); | 481 int end_token, bool* ok); |
| 479 Statement* ParseStatement(ZoneStringList* labels, bool* ok); | 482 Statement* ParseStatement(ZoneStringList* labels, bool* ok); |
| 480 Statement* ParseFunctionDeclaration(bool* ok); | 483 Statement* ParseFunctionDeclaration(bool* ok); |
| 481 Statement* ParseNativeDeclaration(bool* ok); | 484 Statement* ParseNativeDeclaration(bool* ok); |
| 482 Block* ParseBlock(ZoneStringList* labels, bool* ok); | 485 Block* ParseBlock(ZoneStringList* labels, bool* ok); |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 // Converts the currently parsed literal to a JavaScript String. | 805 // Converts the currently parsed literal to a JavaScript String. |
| 803 Handle<String> GetString(); | 806 Handle<String> GetString(); |
| 804 | 807 |
| 805 Isolate* isolate_; | 808 Isolate* isolate_; |
| 806 JsonScanner scanner_; | 809 JsonScanner scanner_; |
| 807 bool stack_overflow_; | 810 bool stack_overflow_; |
| 808 }; | 811 }; |
| 809 } } // namespace v8::internal | 812 } } // namespace v8::internal |
| 810 | 813 |
| 811 #endif // V8_PARSER_H_ | 814 #endif // V8_PARSER_H_ |
| OLD | NEW |