OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #include "src/ostreams.h" | 5 #include "src/ostreams.h" |
6 #include "src/regexp/regexp-ast.h" | 6 #include "src/regexp/regexp-ast.h" |
7 | 7 |
8 namespace v8 { | 8 namespace v8 { |
9 namespace internal { | 9 namespace internal { |
10 | 10 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 for (int i = 0; i < that->nodes()->length(); i++) { | 165 for (int i = 0; i < that->nodes()->length(); i++) { |
166 os_ << " "; | 166 os_ << " "; |
167 that->nodes()->at(i)->Accept(this, data); | 167 that->nodes()->at(i)->Accept(this, data); |
168 } | 168 } |
169 os_ << ")"; | 169 os_ << ")"; |
170 return NULL; | 170 return NULL; |
171 } | 171 } |
172 | 172 |
173 | 173 |
174 void RegExpUnparser::VisitCharacterRange(CharacterRange that) { | 174 void RegExpUnparser::VisitCharacterRange(CharacterRange that) { |
175 os_ << AsUC32(that.from()); | 175 os_ << AsUC16(that.from()); |
176 if (!that.IsSingleton()) { | 176 if (!that.IsSingleton()) { |
177 os_ << "-" << AsUC32(that.to()); | 177 os_ << "-" << AsUC16(that.to()); |
178 } | 178 } |
179 } | 179 } |
180 | 180 |
181 | 181 |
182 void* RegExpUnparser::VisitCharacterClass(RegExpCharacterClass* that, | 182 void* RegExpUnparser::VisitCharacterClass(RegExpCharacterClass* that, |
183 void* data) { | 183 void* data) { |
184 if (that->is_negated()) os_ << "^"; | 184 if (that->is_negated()) os_ << "^"; |
185 os_ << "["; | 185 os_ << "["; |
186 for (int i = 0; i < that->ranges(zone_)->length(); i++) { | 186 for (int i = 0; i < that->ranges(zone_)->length(); i++) { |
187 if (i > 0) os_ << " "; | 187 if (i > 0) os_ << " "; |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 int node_min_match = node->min_match(); | 328 int node_min_match = node->min_match(); |
329 min_match_ = IncreaseBy(min_match_, node_min_match); | 329 min_match_ = IncreaseBy(min_match_, node_min_match); |
330 int node_max_match = node->max_match(); | 330 int node_max_match = node->max_match(); |
331 max_match_ = IncreaseBy(max_match_, node_max_match); | 331 max_match_ = IncreaseBy(max_match_, node_max_match); |
332 } | 332 } |
333 } | 333 } |
334 | 334 |
335 | 335 |
336 } // namespace internal | 336 } // namespace internal |
337 } // namespace v8 | 337 } // namespace v8 |
OLD | NEW |