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 return v8::internal::WhiteSpace::Is(c); | 448 switch (c) { |
| 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 } |
449 } | 463 } |
450 | 464 |
451 | 465 |
452 static bool NotWhiteSpace(uc16 c) { | 466 static bool NotWhiteSpace(uc16 c) { |
453 return !IsWhiteSpace(c); | 467 return !IsWhiteSpace(c); |
454 } | 468 } |
455 | 469 |
456 | 470 |
457 static bool NotWord(uc16 c) { | 471 static bool NotWord(uc16 c) { |
458 return !IsRegExpWord(c); | 472 return !IsRegExpWord(c); |
(...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1794 ZoneList<CharacterRange> first_only(4, &zone); | 1808 ZoneList<CharacterRange> first_only(4, &zone); |
1795 ZoneList<CharacterRange> second_only(4, &zone); | 1809 ZoneList<CharacterRange> second_only(4, &zone); |
1796 ZoneList<CharacterRange> both(4, &zone); | 1810 ZoneList<CharacterRange> both(4, &zone); |
1797 } | 1811 } |
1798 | 1812 |
1799 | 1813 |
1800 TEST(Graph) { | 1814 TEST(Graph) { |
1801 V8::Initialize(NULL); | 1815 V8::Initialize(NULL); |
1802 Execute("\\b\\w+\\b", false, true, true); | 1816 Execute("\\b\\w+\\b", false, true, true); |
1803 } | 1817 } |
OLD | NEW |