OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
438 return ('0' <= c && c <= '9'); | 438 return ('0' <= c && c <= '9'); |
439 } | 439 } |
440 | 440 |
441 | 441 |
442 static bool NotDigit(uc16 c) { | 442 static bool NotDigit(uc16 c) { |
443 return !IsDigit(c); | 443 return !IsDigit(c); |
444 } | 444 } |
445 | 445 |
446 | 446 |
447 static bool IsWhiteSpace(uc16 c) { | 447 static bool IsWhiteSpace(uc16 c) { |
448 switch (c) { | 448 return CcTest::i_isolate()->unicode_cache()->IsWhiteSpace(c); |
Michael Starzinger
2014/02/07 12:25:49
nit: Would it be possible to go directly to the v8
Yang
2014/02/07 12:34:24
Done.
| |
449 case 0x09: | |
450 case 0x0A: | |
451 case 0x0B: | |
452 case 0x0C: | |
453 case 0x0d: | |
454 case 0x20: | |
455 case 0xA0: | |
456 case 0x2028: | |
457 case 0x2029: | |
458 case 0xFEFF: | |
459 return true; | |
460 default: | |
461 return unibrow::Space::Is(c); | |
462 } | |
463 } | 449 } |
464 | 450 |
465 | 451 |
466 static bool NotWhiteSpace(uc16 c) { | 452 static bool NotWhiteSpace(uc16 c) { |
467 return !IsWhiteSpace(c); | 453 return !IsWhiteSpace(c); |
468 } | 454 } |
469 | 455 |
470 | 456 |
471 static bool NotWord(uc16 c) { | 457 static bool NotWord(uc16 c) { |
472 return !IsRegExpWord(c); | 458 return !IsRegExpWord(c); |
(...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1808 ZoneList<CharacterRange> first_only(4, &zone); | 1794 ZoneList<CharacterRange> first_only(4, &zone); |
1809 ZoneList<CharacterRange> second_only(4, &zone); | 1795 ZoneList<CharacterRange> second_only(4, &zone); |
1810 ZoneList<CharacterRange> both(4, &zone); | 1796 ZoneList<CharacterRange> both(4, &zone); |
1811 } | 1797 } |
1812 | 1798 |
1813 | 1799 |
1814 TEST(Graph) { | 1800 TEST(Graph) { |
1815 V8::Initialize(NULL); | 1801 V8::Initialize(NULL); |
1816 Execute("\\b\\w+\\b", false, true, true); | 1802 Execute("\\b\\w+\\b", false, true, true); |
1817 } | 1803 } |
OLD | NEW |