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

Side by Side Diff: src/parsing/preparser.h

Issue 1808373003: Implement ES2015 labelled function declaration restrictions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 months 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
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_PARSING_PREPARSER_H 5 #ifndef V8_PARSING_PREPARSER_H
6 #define V8_PARSING_PREPARSER_H 6 #define V8_PARSING_PREPARSER_H
7 7
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/bailout-reason.h" 9 #include "src/bailout-reason.h"
10 #include "src/hashmap.h" 10 #include "src/hashmap.h"
(...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 // are either being counted in the preparser data, or is important 1002 // are either being counted in the preparser data, or is important
1003 // to throw the correct syntax error exceptions. 1003 // to throw the correct syntax error exceptions.
1004 1004
1005 // All ParseXXX functions take as the last argument an *ok parameter 1005 // All ParseXXX functions take as the last argument an *ok parameter
1006 // which is set to false if parsing failed; it is unchanged otherwise. 1006 // which is set to false if parsing failed; it is unchanged otherwise.
1007 // By making the 'exception handling' explicit, we are forced to check 1007 // By making the 'exception handling' explicit, we are forced to check
1008 // for failure at the call sites. 1008 // for failure at the call sites.
1009 Statement ParseStatementListItem(bool* ok); 1009 Statement ParseStatementListItem(bool* ok);
1010 void ParseStatementList(int end_token, bool* ok, 1010 void ParseStatementList(int end_token, bool* ok,
1011 Scanner::BookmarkScope* bookmark = nullptr); 1011 Scanner::BookmarkScope* bookmark = nullptr);
1012 Statement ParseStatement(bool* ok); 1012 Statement ParseStatement(AllowLabelledFunctionStatement, bool* ok);
1013 Statement ParseSubStatement(bool* ok); 1013 Statement ParseSubStatement(AllowLabelledFunctionStatement, bool* ok);
1014 Statement ParseScopedStatement(bool legacy, bool* ok); 1014 Statement ParseScopedStatement(bool legacy, bool* ok);
1015 Statement ParseFunctionDeclaration(bool* ok); 1015 Statement ParseFunctionDeclaration(bool* ok);
1016 Statement ParseClassDeclaration(bool* ok); 1016 Statement ParseClassDeclaration(bool* ok);
1017 Statement ParseBlock(bool* ok); 1017 Statement ParseBlock(bool* ok);
1018 Statement ParseVariableStatement(VariableDeclarationContext var_context, 1018 Statement ParseVariableStatement(VariableDeclarationContext var_context,
1019 bool* ok); 1019 bool* ok);
1020 Statement ParseVariableDeclarations(VariableDeclarationContext var_context, 1020 Statement ParseVariableDeclarations(VariableDeclarationContext var_context,
1021 int* num_decl, bool* is_lexical, 1021 int* num_decl, bool* is_lexical,
1022 bool* is_binding_pattern, 1022 bool* is_binding_pattern,
1023 Scanner::Location* first_initializer_loc, 1023 Scanner::Location* first_initializer_loc,
1024 Scanner::Location* bindings_loc, 1024 Scanner::Location* bindings_loc,
1025 bool* ok); 1025 bool* ok);
1026 Statement ParseExpressionOrLabelledStatement(bool* ok); 1026 Statement ParseExpressionOrLabelledStatement(AllowLabelledFunctionStatement,
1027 bool* ok);
1027 Statement ParseIfStatement(bool* ok); 1028 Statement ParseIfStatement(bool* ok);
1028 Statement ParseContinueStatement(bool* ok); 1029 Statement ParseContinueStatement(bool* ok);
1029 Statement ParseBreakStatement(bool* ok); 1030 Statement ParseBreakStatement(bool* ok);
1030 Statement ParseReturnStatement(bool* ok); 1031 Statement ParseReturnStatement(bool* ok);
1031 Statement ParseWithStatement(bool* ok); 1032 Statement ParseWithStatement(bool* ok);
1032 Statement ParseSwitchStatement(bool* ok); 1033 Statement ParseSwitchStatement(bool* ok);
1033 Statement ParseDoWhileStatement(bool* ok); 1034 Statement ParseDoWhileStatement(bool* ok);
1034 Statement ParseWhileStatement(bool* ok); 1035 Statement ParseWhileStatement(bool* ok);
1035 Statement ParseForStatement(bool* ok); 1036 Statement ParseForStatement(bool* ok);
1036 Statement ParseThrowStatement(bool* ok); 1037 Statement ParseThrowStatement(bool* ok);
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
1149 const PreParserFormalParameters& parameters, FunctionKind kind, 1150 const PreParserFormalParameters& parameters, FunctionKind kind,
1150 FunctionLiteral::FunctionType function_type, bool* ok) { 1151 FunctionLiteral::FunctionType function_type, bool* ok) {
1151 return pre_parser_->ParseEagerFunctionBody(function_name, pos, parameters, 1152 return pre_parser_->ParseEagerFunctionBody(function_name, pos, parameters,
1152 kind, function_type, ok); 1153 kind, function_type, ok);
1153 } 1154 }
1154 1155
1155 } // namespace internal 1156 } // namespace internal
1156 } // namespace v8 1157 } // namespace v8
1157 1158
1158 #endif // V8_PARSING_PREPARSER_H 1159 #endif // V8_PARSING_PREPARSER_H
OLDNEW
« src/parsing/parser.cc ('K') | « src/parsing/parser-base.h ('k') | src/parsing/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698