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

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

Issue 10750: * Update to RegExp parsing and AST. (Closed)
Patch Set: Addressed review comments 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
« no previous file with comments | « regexp2000/src/regexp-macro-assembler-ia32.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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 CHECK_PARSE_EQ("a\\fb\\nc\\rd\\te\\vf", "'a\fb\nc\rd\te\vf'"); 99 CHECK_PARSE_EQ("a\\fb\\nc\\rd\\te\\vf", "'a\fb\nc\rd\te\vf'");
100 CHECK_PARSE_EQ("a\\nb\\bc", "(: 'a\nb' @b 'c')"); 100 CHECK_PARSE_EQ("a\\nb\\bc", "(: 'a\nb' @b 'c')");
101 CHECK_PARSE_EQ("(?:foo)", "'foo'"); 101 CHECK_PARSE_EQ("(?:foo)", "'foo'");
102 CHECK_PARSE_EQ("(?: foo )", "' foo '"); 102 CHECK_PARSE_EQ("(?: foo )", "' foo '");
103 CHECK_PARSE_EQ("(foo|bar|baz)", "(^ (| 'foo' 'bar' 'baz'))"); 103 CHECK_PARSE_EQ("(foo|bar|baz)", "(^ (| 'foo' 'bar' 'baz'))");
104 CHECK_PARSE_EQ("foo|(bar|baz)|quux", "(| 'foo' (^ (| 'bar' 'baz')) 'quux')"); 104 CHECK_PARSE_EQ("foo|(bar|baz)|quux", "(| 'foo' (^ (| 'bar' 'baz')) 'quux')");
105 CHECK_PARSE_EQ("foo(?=bar)baz", "(: 'foo' (-> + 'bar') 'baz')"); 105 CHECK_PARSE_EQ("foo(?=bar)baz", "(: 'foo' (-> + 'bar') 'baz')");
106 CHECK_PARSE_EQ("foo(?!bar)baz", "(: 'foo' (-> - 'bar') 'baz')"); 106 CHECK_PARSE_EQ("foo(?!bar)baz", "(: 'foo' (-> - 'bar') 'baz')");
107 CHECK_PARSE_EQ("()", "(^ %)"); 107 CHECK_PARSE_EQ("()", "(^ %)");
108 CHECK_PARSE_EQ("(?=)", "(-> + %)"); 108 CHECK_PARSE_EQ("(?=)", "(-> + %)");
109 CHECK_PARSE_EQ("[]", "%"); 109 CHECK_PARSE_EQ("[]", "^[\x00-\uffff]");
110 CHECK_PARSE_EQ("[^]", "[\x00-\uffff]");
110 CHECK_PARSE_EQ("[x]", "[x]"); 111 CHECK_PARSE_EQ("[x]", "[x]");
111 CHECK_PARSE_EQ("[xyz]", "[x y z]"); 112 CHECK_PARSE_EQ("[xyz]", "[x y z]");
112 CHECK_PARSE_EQ("[a-zA-Z0-9]", "[a-z A-Z 0-9]"); 113 CHECK_PARSE_EQ("[a-zA-Z0-9]", "[a-z A-Z 0-9]");
113 CHECK_PARSE_EQ("[-123]", "[- 1 2 3]"); 114 CHECK_PARSE_EQ("[-123]", "[- 1 2 3]");
114 CHECK_PARSE_EQ("[^123]", "^[1 2 3]"); 115 CHECK_PARSE_EQ("[^123]", "^[1 2 3]");
115 CHECK_PARSE_EQ("]", "']'"); 116 CHECK_PARSE_EQ("]", "']'");
116 CHECK_PARSE_EQ("}", "'}'"); 117 CHECK_PARSE_EQ("}", "'}'");
117 CHECK_PARSE_EQ("[a-b-c]", "[a-b - c]"); 118 CHECK_PARSE_EQ("[a-b-c]", "[a-b - c]");
118 CHECK_PARSE_EQ("[\\d]", "[0-9]"); 119 CHECK_PARSE_EQ("[\\d]", "[0-9]");
119 CHECK_PARSE_EQ("[x\\dz]", "[x 0-9 z]"); 120 CHECK_PARSE_EQ("[x\\dz]", "[x 0-9 z]");
(...skipping 28 matching lines...) Expand all
148 " (# 0 - g (<- 3)))"); 149 " (# 0 - g (<- 3)))");
149 CHECK_PARSE_EQ("(x)(x)(x)\\4*", "(: (^ 'x') (^ 'x') (^ 'x')" 150 CHECK_PARSE_EQ("(x)(x)(x)\\4*", "(: (^ 'x') (^ 'x') (^ 'x')"
150 " (# 0 - g '\x04'))"); 151 " (# 0 - g '\x04'))");
151 CHECK_PARSE_EQ("(x)(x)(x)(x)(x)(x)(x)(x)(x)(x)\\10", 152 CHECK_PARSE_EQ("(x)(x)(x)(x)(x)(x)(x)(x)(x)(x)\\10",
152 "(: (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x')" 153 "(: (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x')"
153 " (^ 'x') (^ 'x') (^ 'x') (^ 'x') (<- 10))"); 154 " (^ 'x') (^ 'x') (^ 'x') (^ 'x') (<- 10))");
154 CHECK_PARSE_EQ("(x)(x)(x)(x)(x)(x)(x)(x)(x)(x)\\11", 155 CHECK_PARSE_EQ("(x)(x)(x)(x)(x)(x)(x)(x)(x)(x)\\11",
155 "(: (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x')" 156 "(: (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x') (^ 'x')"
156 " (^ 'x') (^ 'x') (^ 'x') (^ 'x') '\x09')"); 157 " (^ 'x') (^ 'x') (^ 'x') (^ 'x') '\x09')");
157 CHECK_PARSE_EQ("(a)\\1", "(: (^ 'a') (<- 1))"); 158 CHECK_PARSE_EQ("(a)\\1", "(: (^ 'a') (<- 1))");
158 CHECK_PARSE_EQ("(a\\1)", "(^ (: 'a' (<- 1)))"); 159 CHECK_PARSE_EQ("(a\\1)", "(^ 'a')");
159 CHECK_PARSE_EQ("(\\1a)", "(^ (: (<- 1) 'a'))"); 160 CHECK_PARSE_EQ("(\\1a)", "(^ 'a')");
160 CHECK_PARSE_EQ("\\1(a)", "(: '\x01' (^ 'a'))"); 161 CHECK_PARSE_EQ("\\1(a)", "(: '\x01' (^ 'a'))");
162 CHECK_PARSE_EQ("(?!(a))\\1", "(-> - (^ 'a'))");
163 CHECK_PARSE_EQ("(?!\\1(a\\1)\\1)\\1", "(-> - (: '\x01' (^ 'a') (<- 1)))");
161 CHECK_PARSE_EQ("[\\0]", "[\0]"); 164 CHECK_PARSE_EQ("[\\0]", "[\0]");
162 CHECK_PARSE_EQ("[\\11]", "[\t]"); 165 CHECK_PARSE_EQ("[\\11]", "[\t]");
163 CHECK_PARSE_EQ("[\\11a]", "[\t a]"); 166 CHECK_PARSE_EQ("[\\11a]", "[\t a]");
164 CHECK_PARSE_EQ("[\\011]", "[\t]"); 167 CHECK_PARSE_EQ("[\\011]", "[\t]");
165 CHECK_PARSE_EQ("[\\00011]", "[\000 1 1]"); 168 CHECK_PARSE_EQ("[\\00011]", "[\000 1 1]");
166 CHECK_PARSE_EQ("[\\118]", "[\t 8]"); 169 CHECK_PARSE_EQ("[\\118]", "[\t 8]");
167 CHECK_PARSE_EQ("[\\111]", "[I]"); 170 CHECK_PARSE_EQ("[\\111]", "[I]");
168 CHECK_PARSE_EQ("[\\1111]", "[I 1]"); 171 CHECK_PARSE_EQ("[\\1111]", "[I 1]");
169 CHECK_PARSE_EQ("\\x34", "'\x34'"); 172 CHECK_PARSE_EQ("\\x34", "'\x34'");
170 CHECK_PARSE_EQ("\\x60", "'\x60'"); 173 CHECK_PARSE_EQ("\\x60", "'\x60'");
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 cons.set_choice_index(0); 702 cons.set_choice_index(0);
700 cons.AddInverse(ranges); 703 cons.AddInverse(ranges);
701 CHECK(!table.Get(0xFFFE)->Get(0)); 704 CHECK(!table.Get(0xFFFE)->Get(0));
702 CHECK(table.Get(0xFFFF)->Get(0)); 705 CHECK(table.Get(0xFFFF)->Get(0));
703 } 706 }
704 707
705 708
706 TEST(Graph) { 709 TEST(Graph) {
707 Execute("a|(b|c)|d", "", true); 710 Execute("a|(b|c)|d", "", true);
708 } 711 }
OLDNEW
« no previous file with comments | « regexp2000/src/regexp-macro-assembler-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698