| OLD | NEW |
| 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 27 matching lines...) Expand all Loading... |
| 38 #include "jsregexp-inl.h" | 38 #include "jsregexp-inl.h" |
| 39 #include "assembler-re2k.h" | 39 #include "assembler-re2k.h" |
| 40 #include "regexp-macro-assembler.h" | 40 #include "regexp-macro-assembler.h" |
| 41 #include "regexp-macro-assembler-re2k.h" | 41 #include "regexp-macro-assembler-re2k.h" |
| 42 #include "interpreter-re2k.h" | 42 #include "interpreter-re2k.h" |
| 43 | 43 |
| 44 | 44 |
| 45 using namespace v8::internal; | 45 using namespace v8::internal; |
| 46 | 46 |
| 47 | 47 |
| 48 static SmartPointer<char> Parse(const char* input) { | 48 static SmartPointer<const char> Parse(const char* input) { |
| 49 v8::HandleScope scope; | 49 v8::HandleScope scope; |
| 50 unibrow::Utf8InputBuffer<> buffer(input, strlen(input)); | 50 unibrow::Utf8InputBuffer<> buffer(input, strlen(input)); |
| 51 ZoneScope zone_scope(DELETE_ON_EXIT); | 51 ZoneScope zone_scope(DELETE_ON_EXIT); |
| 52 RegExpParseResult result; | 52 RegExpParseResult result; |
| 53 CHECK(v8::internal::ParseRegExp(&buffer, &result)); | 53 CHECK(v8::internal::ParseRegExp(&buffer, &result)); |
| 54 CHECK(result.tree != NULL); | 54 CHECK(result.tree != NULL); |
| 55 CHECK(result.error.is_null()); | 55 CHECK(result.error.is_null()); |
| 56 SmartPointer<char> output = result.tree->ToString(); | 56 SmartPointer<const char> output = result.tree->ToString(); |
| 57 return output; | 57 return output; |
| 58 } | 58 } |
| 59 | 59 |
| 60 static bool ParseEscapes(const char* input) { | 60 static bool ParseEscapes(const char* input) { |
| 61 v8::HandleScope scope; | 61 v8::HandleScope scope; |
| 62 unibrow::Utf8InputBuffer<> buffer(input, strlen(input)); | 62 unibrow::Utf8InputBuffer<> buffer(input, strlen(input)); |
| 63 ZoneScope zone_scope(DELETE_ON_EXIT); | 63 ZoneScope zone_scope(DELETE_ON_EXIT); |
| 64 RegExpParseResult result; | 64 RegExpParseResult result; |
| 65 CHECK(v8::internal::ParseRegExp(&buffer, &result)); | 65 CHECK(v8::internal::ParseRegExp(&buffer, &result)); |
| 66 CHECK(result.tree != NULL); | 66 CHECK(result.tree != NULL); |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 DispatchTable table; | 694 DispatchTable table; |
| 695 CharacterClassNode::AddInverseToTable(ranges, &table, 0); | 695 CharacterClassNode::AddInverseToTable(ranges, &table, 0); |
| 696 CHECK(!table.Get(0xFFFE)->Get(0)); | 696 CHECK(!table.Get(0xFFFE)->Get(0)); |
| 697 CHECK(table.Get(0xFFFF)->Get(0)); | 697 CHECK(table.Get(0xFFFF)->Get(0)); |
| 698 } | 698 } |
| 699 | 699 |
| 700 | 700 |
| 701 TEST(Graph) { | 701 TEST(Graph) { |
| 702 Execute(".*?[^a]|b", "", true); | 702 Execute(".*?[^a]|b", "", true); |
| 703 } | 703 } |
| OLD | NEW |