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

Side by Side Diff: src/parsing/expression-classifier.h

Issue 2277843002: [parser] Clean up (pre)parser traits, part 5, last (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@nickie-2274113002-ref-traits
Patch Set: Created 4 years, 3 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 | src/parsing/parser.h » ('j') | src/parsing/parser.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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_EXPRESSION_CLASSIFIER_H 5 #ifndef V8_PARSING_EXPRESSION_CLASSIFIER_H
6 #define V8_PARSING_EXPRESSION_CLASSIFIER_H 6 #define V8_PARSING_EXPRESSION_CLASSIFIER_H
7 7
8 #include "src/messages.h" 8 #include "src/messages.h"
9 #include "src/parsing/scanner.h" 9 #include "src/parsing/scanner.h"
10 #include "src/parsing/token.h" 10 #include "src/parsing/token.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 AllProductions = 70 AllProductions =
71 (ExpressionProductions | PatternProductions | 71 (ExpressionProductions | PatternProductions |
72 FormalParametersProductions | ArrowFormalParametersProduction | 72 FormalParametersProductions | ArrowFormalParametersProduction |
73 ObjectLiteralProduction | AsyncArrowFormalParametersProduction) 73 ObjectLiteralProduction | AsyncArrowFormalParametersProduction)
74 }; 74 };
75 75
76 enum FunctionProperties : unsigned { 76 enum FunctionProperties : unsigned {
77 NonSimpleParameter = 1 << 0 77 NonSimpleParameter = 1 << 0
78 }; 78 };
79 79
80 explicit ExpressionClassifier(const Traits* t) 80 explicit ExpressionClassifier(const typename Traits::Type::Base* base,
81 : zone_(t->zone()), 81 DuplicateFinder* duplicate_finder = nullptr)
82 non_patterns_to_rewrite_(t->GetNonPatternList()), 82 : zone_(base->impl()->zone()),
83 reported_errors_(t->GetReportedErrorList()), 83 non_patterns_to_rewrite_(base->impl()->GetNonPatternList()),
84 duplicate_finder_(nullptr), 84 reported_errors_(base->impl()->GetReportedErrorList()),
85 invalid_productions_(0),
86 function_properties_(0) {
87 reported_errors_begin_ = reported_errors_end_ = reported_errors_->length();
88 non_pattern_begin_ = non_patterns_to_rewrite_->length();
89 }
90
91 ExpressionClassifier(const Traits* t, DuplicateFinder* duplicate_finder)
92 : zone_(t->zone()),
93 non_patterns_to_rewrite_(t->GetNonPatternList()),
94 reported_errors_(t->GetReportedErrorList()),
95 duplicate_finder_(duplicate_finder), 85 duplicate_finder_(duplicate_finder),
96 invalid_productions_(0), 86 invalid_productions_(0),
97 function_properties_(0) { 87 function_properties_(0) {
98 reported_errors_begin_ = reported_errors_end_ = reported_errors_->length(); 88 reported_errors_begin_ = reported_errors_end_ = reported_errors_->length();
99 non_pattern_begin_ = non_patterns_to_rewrite_->length(); 89 non_pattern_begin_ = non_patterns_to_rewrite_->length();
100 } 90 }
101 91
102 ~ExpressionClassifier() { Discard(); } 92 ~ExpressionClassifier() { Discard(); }
103 93
104 V8_INLINE bool is_valid(unsigned productions) const { 94 V8_INLINE bool is_valid(unsigned productions) const {
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 }; 449 };
460 450
461 451
462 #undef ERROR_CODES 452 #undef ERROR_CODES
463 453
464 454
465 } // namespace internal 455 } // namespace internal
466 } // namespace v8 456 } // namespace v8
467 457
468 #endif // V8_PARSING_EXPRESSION_CLASSIFIER_H 458 #endif // V8_PARSING_EXPRESSION_CLASSIFIER_H
OLDNEW
« no previous file with comments | « no previous file | src/parsing/parser.h » ('j') | src/parsing/parser.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698