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

Side by Side Diff: test/cctest/test-regexp.cc

Issue 11350: Add back references. Since "back references" is two words... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/regexp2000/
Patch Set: Created 12 years, 1 month 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 | Annotate | Revision Log
« src/parser.cc ('K') | « src/regexp-macro-assembler-re2k.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 " (# 0 - g '\\x04'))"); 153 " (# 0 - g '\\x04'))");
154 CHECK_PARSE_EQ("(x)(x)(x)(x)(x)(x)(x)(x)(x)(x)\\10", 154 CHECK_PARSE_EQ("(x)(x)(x)(x)(x)(x)(x)(x)(x)(x)\\10",
155 "(: (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x')" 155 "(: (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x')"
156 " (^ 'x') (^ 'x') (^ 'x') (^ 'x') (<- 10))"); 156 " (^ 'x') (^ 'x') (^ 'x') (^ 'x') (<- 10))");
157 CHECK_PARSE_EQ("(x)(x)(x)(x)(x)(x)(x)(x)(x)(x)\\11", 157 CHECK_PARSE_EQ("(x)(x)(x)(x)(x)(x)(x)(x)(x)(x)\\11",
158 "(: (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x')" 158 "(: (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x')"
159 " (^ 'x') (^ 'x') (^ 'x') (^ 'x') '\\x09')"); 159 " (^ 'x') (^ 'x') (^ 'x') (^ 'x') '\\x09')");
160 CHECK_PARSE_EQ("(a)\\1", "(: (^ 'a') (<- 1))"); 160 CHECK_PARSE_EQ("(a)\\1", "(: (^ 'a') (<- 1))");
161 CHECK_PARSE_EQ("(a\\1)", "(^ 'a')"); 161 CHECK_PARSE_EQ("(a\\1)", "(^ 'a')");
162 CHECK_PARSE_EQ("(\\1a)", "(^ 'a')"); 162 CHECK_PARSE_EQ("(\\1a)", "(^ 'a')");
163 CHECK_PARSE_EQ("\\1(a)", "(: '\\x01' (^ 'a'))"); 163 CHECK_PARSE_EQ("\\1(a)", "(^ 'a')");
164 CHECK_PARSE_EQ("(?!(a))\\1", "(-> - (^ 'a'))"); 164 CHECK_PARSE_EQ("(?!(a))\\1", "(-> - (^ 'a'))");
165 CHECK_PARSE_EQ("(?!\\1(a\\1)\\1)\\1", "(-> - (: '\\x01' (^ 'a') (<- 1)))"); 165 CHECK_PARSE_EQ("(?!\\1(a\\1)\\1)\\1", "(-> - (: (^ 'a') (<- 1)))");
166 CHECK_PARSE_EQ("[\\0]", "[\\x00]"); 166 CHECK_PARSE_EQ("[\\0]", "[\\x00]");
167 CHECK_PARSE_EQ("[\\11]", "[\\x09]"); 167 CHECK_PARSE_EQ("[\\11]", "[\\x09]");
168 CHECK_PARSE_EQ("[\\11a]", "[\\x09 a]"); 168 CHECK_PARSE_EQ("[\\11a]", "[\\x09 a]");
169 CHECK_PARSE_EQ("[\\011]", "[\\x09]"); 169 CHECK_PARSE_EQ("[\\011]", "[\\x09]");
170 CHECK_PARSE_EQ("[\\00011]", "[\\x00 1 1]"); 170 CHECK_PARSE_EQ("[\\00011]", "[\\x00 1 1]");
171 CHECK_PARSE_EQ("[\\118]", "[\\x09 8]"); 171 CHECK_PARSE_EQ("[\\118]", "[\\x09 8]");
172 CHECK_PARSE_EQ("[\\111]", "[I]"); 172 CHECK_PARSE_EQ("[\\111]", "[I]");
173 CHECK_PARSE_EQ("[\\1111]", "[I 1]"); 173 CHECK_PARSE_EQ("[\\1111]", "[I 1]");
174 CHECK_PARSE_EQ("\\x34", "'\x34'"); 174 CHECK_PARSE_EQ("\\x34", "'\x34'");
175 CHECK_PARSE_EQ("\\x60", "'\x60'"); 175 CHECK_PARSE_EQ("\\x60", "'\x60'");
(...skipping 13 matching lines...) Expand all
189 CHECK_ESCAPES("a*?", false); 189 CHECK_ESCAPES("a*?", false);
190 CHECK_ESCAPES("a?", false); 190 CHECK_ESCAPES("a?", false);
191 CHECK_ESCAPES("a??", false); 191 CHECK_ESCAPES("a??", false);
192 CHECK_ESCAPES("a{0,1}?", false); 192 CHECK_ESCAPES("a{0,1}?", false);
193 CHECK_ESCAPES("a{1,1}?", false); 193 CHECK_ESCAPES("a{1,1}?", false);
194 CHECK_ESCAPES("a{1,2}?", false); 194 CHECK_ESCAPES("a{1,2}?", false);
195 CHECK_ESCAPES("a+?", false); 195 CHECK_ESCAPES("a+?", false);
196 CHECK_ESCAPES("(a)", false); 196 CHECK_ESCAPES("(a)", false);
197 CHECK_ESCAPES("(a)\\1", false); 197 CHECK_ESCAPES("(a)\\1", false);
198 CHECK_ESCAPES("(\\1a)", false); 198 CHECK_ESCAPES("(\\1a)", false);
199 CHECK_ESCAPES("\\1(a)", true); 199 CHECK_ESCAPES("\\1(a)", false);
200 CHECK_ESCAPES("a\\s", false); 200 CHECK_ESCAPES("a\\s", false);
201 CHECK_ESCAPES("a\\S", false); 201 CHECK_ESCAPES("a\\S", false);
202 CHECK_ESCAPES("a\\d", false); 202 CHECK_ESCAPES("a\\d", false);
203 CHECK_ESCAPES("a\\D", false); 203 CHECK_ESCAPES("a\\D", false);
204 CHECK_ESCAPES("a\\w", false); 204 CHECK_ESCAPES("a\\w", false);
205 CHECK_ESCAPES("a\\W", false); 205 CHECK_ESCAPES("a\\W", false);
206 CHECK_ESCAPES("a.", false); 206 CHECK_ESCAPES("a.", false);
207 CHECK_ESCAPES("a\\q", true); 207 CHECK_ESCAPES("a\\q", true);
208 CHECK_ESCAPES("a[a]", false); 208 CHECK_ESCAPES("a[a]", false);
209 CHECK_ESCAPES("a[^a]", false); 209 CHECK_ESCAPES("a[^a]", false);
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 TEST(SimplePropagation) { 807 TEST(SimplePropagation) {
808 v8::HandleScope scope; 808 v8::HandleScope scope;
809 ZoneScope zone_scope(DELETE_ON_EXIT); 809 ZoneScope zone_scope(DELETE_ON_EXIT);
810 RegExpNode* node = Compile("(a|^b|c)"); 810 RegExpNode* node = Compile("(a|^b|c)");
811 CHECK(node->info()->determine_start); 811 CHECK(node->info()->determine_start);
812 } 812 }
813 813
814 814
815 TEST(Graph) { 815 TEST(Graph) {
816 V8::Initialize(NULL); 816 V8::Initialize(NULL);
817 Execute(".*o(?=o)", "", true); 817 Execute("(x)?\\1y", "", true);
818 } 818 }
OLDNEW
« src/parser.cc ('K') | « src/regexp-macro-assembler-re2k.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698