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

Side by Side Diff: src/parsing/scanner.cc

Issue 2780173002: [regexp] Add support for dotAll flag (Closed)
Patch Set: Address comments Created 3 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 | « src/objects.cc ('k') | src/regexp/regexp-parser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 // Features shared by parsing and pre-parsing scanners. 5 // Features shared by parsing and pre-parsing scanners.
6 6
7 #include "src/parsing/scanner.h" 7 #include "src/parsing/scanner.h"
8 8
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after
1710 switch (c0_) { 1710 switch (c0_) {
1711 case 'g': 1711 case 'g':
1712 flag = RegExp::kGlobal; 1712 flag = RegExp::kGlobal;
1713 break; 1713 break;
1714 case 'i': 1714 case 'i':
1715 flag = RegExp::kIgnoreCase; 1715 flag = RegExp::kIgnoreCase;
1716 break; 1716 break;
1717 case 'm': 1717 case 'm':
1718 flag = RegExp::kMultiline; 1718 flag = RegExp::kMultiline;
1719 break; 1719 break;
1720 case 's':
1721 if (FLAG_harmony_regexp_dotall) {
1722 flag = RegExp::kDotAll;
1723 } else {
1724 return Nothing<RegExp::Flags>();
1725 }
1726 break;
1720 case 'u': 1727 case 'u':
1721 flag = RegExp::kUnicode; 1728 flag = RegExp::kUnicode;
1722 break; 1729 break;
1723 case 'y': 1730 case 'y':
1724 flag = RegExp::kSticky; 1731 flag = RegExp::kSticky;
1725 break; 1732 break;
1726 default: 1733 default:
1727 return Nothing<RegExp::Flags>(); 1734 return Nothing<RegExp::Flags>();
1728 } 1735 }
1729 if (flags & flag) { 1736 if (flags & flag) {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
1808 // 2, reset the source to the desired position, 1815 // 2, reset the source to the desired position,
1809 source_->Seek(position); 1816 source_->Seek(position);
1810 // 3, re-scan, by scanning the look-ahead char + 1 token (next_). 1817 // 3, re-scan, by scanning the look-ahead char + 1 token (next_).
1811 c0_ = source_->Advance(); 1818 c0_ = source_->Advance();
1812 Next(); 1819 Next();
1813 DCHECK_EQ(next_.location.beg_pos, static_cast<int>(position)); 1820 DCHECK_EQ(next_.location.beg_pos, static_cast<int>(position));
1814 } 1821 }
1815 1822
1816 } // namespace internal 1823 } // namespace internal
1817 } // namespace v8 1824 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/regexp/regexp-parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698