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/regexp/regexp-parser.h" | 5 #include "src/regexp/regexp-parser.h" |
6 | 6 |
7 #include "src/char-predicates-inl.h" | 7 #include "src/char-predicates-inl.h" |
8 #include "src/factory.h" | 8 #include "src/factory.h" |
9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
(...skipping 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1600 if (characters_ == NULL) { | 1600 if (characters_ == NULL) { |
1601 characters_ = new (zone()) ZoneList<uc16>(4, zone()); | 1601 characters_ = new (zone()) ZoneList<uc16>(4, zone()); |
1602 } | 1602 } |
1603 characters_->Add(c, zone()); | 1603 characters_->Add(c, zone()); |
1604 LAST(ADD_CHAR); | 1604 LAST(ADD_CHAR); |
1605 } | 1605 } |
1606 } | 1606 } |
1607 | 1607 |
1608 | 1608 |
1609 void RegExpBuilder::AddUnicodeCharacter(uc32 c) { | 1609 void RegExpBuilder::AddUnicodeCharacter(uc32 c) { |
1610 if (c > unibrow::Utf16::kMaxNonSurrogateCharCode) { | 1610 if (c > static_cast<uc32>(unibrow::Utf16::kMaxNonSurrogateCharCode)) { |
1611 DCHECK(unicode()); | 1611 DCHECK(unicode()); |
1612 AddLeadSurrogate(unibrow::Utf16::LeadSurrogate(c)); | 1612 AddLeadSurrogate(unibrow::Utf16::LeadSurrogate(c)); |
1613 AddTrailSurrogate(unibrow::Utf16::TrailSurrogate(c)); | 1613 AddTrailSurrogate(unibrow::Utf16::TrailSurrogate(c)); |
1614 } else if (unicode() && unibrow::Utf16::IsLeadSurrogate(c)) { | 1614 } else if (unicode() && unibrow::Utf16::IsLeadSurrogate(c)) { |
1615 AddLeadSurrogate(c); | 1615 AddLeadSurrogate(c); |
1616 } else if (unicode() && unibrow::Utf16::IsTrailSurrogate(c)) { | 1616 } else if (unicode() && unibrow::Utf16::IsTrailSurrogate(c)) { |
1617 AddTrailSurrogate(c); | 1617 AddTrailSurrogate(c); |
1618 } else { | 1618 } else { |
1619 AddCharacter(static_cast<uc16>(c)); | 1619 AddCharacter(static_cast<uc16>(c)); |
1620 } | 1620 } |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1787 return false; | 1787 return false; |
1788 } | 1788 } |
1789 terms_.Add(new (zone()) RegExpQuantifier(min, max, quantifier_type, atom), | 1789 terms_.Add(new (zone()) RegExpQuantifier(min, max, quantifier_type, atom), |
1790 zone()); | 1790 zone()); |
1791 LAST(ADD_TERM); | 1791 LAST(ADD_TERM); |
1792 return true; | 1792 return true; |
1793 } | 1793 } |
1794 | 1794 |
1795 } // namespace internal | 1795 } // namespace internal |
1796 } // namespace v8 | 1796 } // namespace v8 |
OLD | NEW |