OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 " (^ 'x') (^ 'x') (^ 'x') (^ 'x') '\\x09')"); | 197 " (^ 'x') (^ 'x') (^ 'x') (^ 'x') '\\x09')"); |
198 CHECK_PARSE_EQ("(a)\\1", "(: (^ 'a') (<- 1))"); | 198 CHECK_PARSE_EQ("(a)\\1", "(: (^ 'a') (<- 1))"); |
199 CHECK_PARSE_EQ("(a\\1)", "(^ 'a')"); | 199 CHECK_PARSE_EQ("(a\\1)", "(^ 'a')"); |
200 CHECK_PARSE_EQ("(\\1a)", "(^ 'a')"); | 200 CHECK_PARSE_EQ("(\\1a)", "(^ 'a')"); |
201 CHECK_PARSE_EQ("(?=a)?a", "'a'"); | 201 CHECK_PARSE_EQ("(?=a)?a", "'a'"); |
202 CHECK_PARSE_EQ("(?=a){0,10}a", "'a'"); | 202 CHECK_PARSE_EQ("(?=a){0,10}a", "'a'"); |
203 CHECK_PARSE_EQ("(?=a){1,10}a", "(: (-> + 'a') 'a')"); | 203 CHECK_PARSE_EQ("(?=a){1,10}a", "(: (-> + 'a') 'a')"); |
204 CHECK_PARSE_EQ("(?=a){9,10}a", "(: (-> + 'a') 'a')"); | 204 CHECK_PARSE_EQ("(?=a){9,10}a", "(: (-> + 'a') 'a')"); |
205 CHECK_PARSE_EQ("(?!a)?a", "'a'"); | 205 CHECK_PARSE_EQ("(?!a)?a", "'a'"); |
206 CHECK_PARSE_EQ("\\1(a)", "(^ 'a')"); | 206 CHECK_PARSE_EQ("\\1(a)", "(^ 'a')"); |
207 CHECK_PARSE_EQ("(?!(a))\\1", "(-> - (^ 'a'))"); | 207 CHECK_PARSE_EQ("(?!(a))\\1", "(: (-> - (^ 'a')) (<- 1))"); |
208 CHECK_PARSE_EQ("(?!\\1(a\\1)\\1)\\1", "(-> - (: (^ 'a') (<- 1)))"); | 208 CHECK_PARSE_EQ("(?!\\1(a\\1)\\1)\\1", "(: (-> - (: (^ 'a') (<- 1))) (<- 1))"); |
209 CHECK_PARSE_EQ("[\\0]", "[\\x00]"); | 209 CHECK_PARSE_EQ("[\\0]", "[\\x00]"); |
210 CHECK_PARSE_EQ("[\\11]", "[\\x09]"); | 210 CHECK_PARSE_EQ("[\\11]", "[\\x09]"); |
211 CHECK_PARSE_EQ("[\\11a]", "[\\x09 a]"); | 211 CHECK_PARSE_EQ("[\\11a]", "[\\x09 a]"); |
212 CHECK_PARSE_EQ("[\\011]", "[\\x09]"); | 212 CHECK_PARSE_EQ("[\\011]", "[\\x09]"); |
213 CHECK_PARSE_EQ("[\\00011]", "[\\x00 1 1]"); | 213 CHECK_PARSE_EQ("[\\00011]", "[\\x00 1 1]"); |
214 CHECK_PARSE_EQ("[\\118]", "[\\x09 8]"); | 214 CHECK_PARSE_EQ("[\\118]", "[\\x09 8]"); |
215 CHECK_PARSE_EQ("[\\111]", "[I]"); | 215 CHECK_PARSE_EQ("[\\111]", "[I]"); |
216 CHECK_PARSE_EQ("[\\1111]", "[I 1]"); | 216 CHECK_PARSE_EQ("[\\1111]", "[I 1]"); |
217 CHECK_PARSE_EQ("\\x34", "'\x34'"); | 217 CHECK_PARSE_EQ("\\x34", "'\x34'"); |
218 CHECK_PARSE_EQ("\\x60", "'\x60'"); | 218 CHECK_PARSE_EQ("\\x60", "'\x60'"); |
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1527 CHECK(!InClass(i, excluded)); | 1527 CHECK(!InClass(i, excluded)); |
1528 } | 1528 } |
1529 } | 1529 } |
1530 } | 1530 } |
1531 | 1531 |
1532 | 1532 |
1533 TEST(Graph) { | 1533 TEST(Graph) { |
1534 V8::Initialize(NULL); | 1534 V8::Initialize(NULL); |
1535 Execute("(?:(?:x(.))?\1)+$", false, true, true); | 1535 Execute("(?:(?:x(.))?\1)+$", false, true, true); |
1536 } | 1536 } |
OLD | NEW |