Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Side by Side Diff: src/preparser.h

Issue 716833002: Various clean-ups after top-level lexical declarations are done. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_PREPARSER_H 5 #ifndef V8_PREPARSER_H
6 #define V8_PREPARSER_H 6 #define V8_PREPARSER_H
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 1416 matching lines...) Expand 10 before | Expand all | Expand 10 after
1427 1427
1428 PreParser(Scanner* scanner, ParserRecorder* log, uintptr_t stack_limit) 1428 PreParser(Scanner* scanner, ParserRecorder* log, uintptr_t stack_limit)
1429 : ParserBase<PreParserTraits>(scanner, stack_limit, NULL, log, NULL, 1429 : ParserBase<PreParserTraits>(scanner, stack_limit, NULL, log, NULL,
1430 this) {} 1430 this) {}
1431 1431
1432 // Pre-parse the program from the character stream; returns true on 1432 // Pre-parse the program from the character stream; returns true on
1433 // success (even if parsing failed, the pre-parse data successfully 1433 // success (even if parsing failed, the pre-parse data successfully
1434 // captured the syntax error), and false if a stack-overflow happened 1434 // captured the syntax error), and false if a stack-overflow happened
1435 // during parsing. 1435 // during parsing.
1436 PreParseResult PreParseProgram() { 1436 PreParseResult PreParseProgram() {
1437 PreParserScope scope(scope_, GLOBAL_SCOPE); 1437 PreParserScope scope(scope_, SCRIPT_SCOPE);
1438 PreParserFactory factory(NULL); 1438 PreParserFactory factory(NULL);
1439 FunctionState top_scope(&function_state_, &scope_, &scope, &factory); 1439 FunctionState top_scope(&function_state_, &scope_, &scope, &factory);
1440 bool ok = true; 1440 bool ok = true;
1441 int start_position = scanner()->peek_location().beg_pos; 1441 int start_position = scanner()->peek_location().beg_pos;
1442 ParseSourceElements(Token::EOS, &ok); 1442 ParseSourceElements(Token::EOS, &ok);
1443 if (stack_overflow()) return kPreParseStackOverflow; 1443 if (stack_overflow()) return kPreParseStackOverflow;
1444 if (!ok) { 1444 if (!ok) {
1445 ReportUnexpectedToken(scanner()->current_token()); 1445 ReportUnexpectedToken(scanner()->current_token());
1446 } else if (scope_->strict_mode() == STRICT) { 1446 } else if (scope_->strict_mode() == STRICT) {
1447 CheckOctalLiteral(start_position, scanner()->location().end_pos, &ok); 1447 CheckOctalLiteral(start_position, scanner()->location().end_pos, &ok);
(...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after
2861 DCHECK(IsAccessorAccessorConflict(old_type, type)); 2861 DCHECK(IsAccessorAccessorConflict(old_type, type));
2862 // Both accessors of the same type. 2862 // Both accessors of the same type.
2863 parser()->ReportMessage("accessor_get_set"); 2863 parser()->ReportMessage("accessor_get_set");
2864 } 2864 }
2865 *ok = false; 2865 *ok = false;
2866 } 2866 }
2867 } 2867 }
2868 } } // v8::internal 2868 } } // v8::internal
2869 2869
2870 #endif // V8_PREPARSER_H 2870 #endif // V8_PREPARSER_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698