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

Side by Side Diff: src/parsing/parser-base.h

Issue 1891453005: [parser] Relex restriction on reserved words (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | test/cctest/test-parsing.cc » ('j') | test/cctest/test-parsing.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_PARSER_BASE_H 5 #ifndef V8_PARSING_PARSER_BASE_H
6 #define V8_PARSING_PARSER_BASE_H 6 #define V8_PARSING_PARSER_BASE_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 2753 matching lines...) Expand 10 before | Expand all | Expand 10 after
2764 2764
2765 template <class Traits> 2765 template <class Traits>
2766 bool ParserBase<Traits>::IsNextLetKeyword() { 2766 bool ParserBase<Traits>::IsNextLetKeyword() {
2767 DCHECK(peek() == Token::LET); 2767 DCHECK(peek() == Token::LET);
2768 Token::Value next_next = PeekAhead(); 2768 Token::Value next_next = PeekAhead();
2769 switch (next_next) { 2769 switch (next_next) {
2770 case Token::LBRACE: 2770 case Token::LBRACE:
2771 case Token::LBRACK: 2771 case Token::LBRACK:
2772 case Token::IDENTIFIER: 2772 case Token::IDENTIFIER:
2773 case Token::STATIC: 2773 case Token::STATIC:
2774 case Token::LET: // Yes, you can do let let = ... in sloppy mode 2774 case Token::LET: // Yes, you can do let let = ... in sloppy mode
Dan Ehrenberg 2016/04/20 20:59:56 Actually, this comment reflects a previous misunde
mike3 2016/04/21 19:51:20 No worries; I'll remove this line while I'm at it.
2775 case Token::YIELD: 2775 case Token::YIELD:
2776 return true; 2776 return true;
2777 case Token::FUTURE_STRICT_RESERVED_WORD:
2778 return is_sloppy(language_mode());
2777 default: 2779 default:
2778 return false; 2780 return false;
2779 } 2781 }
2780 } 2782 }
2781 2783
2782 2784
2783 template <class Traits> 2785 template <class Traits>
2784 typename ParserBase<Traits>::ExpressionT 2786 typename ParserBase<Traits>::ExpressionT
2785 ParserBase<Traits>::ParseArrowFunctionLiteral( 2787 ParserBase<Traits>::ParseArrowFunctionLiteral(
2786 bool accept_IN, const FormalParametersT& formal_parameters, 2788 bool accept_IN, const FormalParametersT& formal_parameters,
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
3096 has_seen_constructor_ = true; 3098 has_seen_constructor_ = true;
3097 return; 3099 return;
3098 } 3100 }
3099 } 3101 }
3100 3102
3101 3103
3102 } // namespace internal 3104 } // namespace internal
3103 } // namespace v8 3105 } // namespace v8
3104 3106
3105 #endif // V8_PARSING_PARSER_BASE_H 3107 #endif // V8_PARSING_PARSER_BASE_H
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-parsing.cc » ('j') | test/cctest/test-parsing.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698