| 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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 | 353 |
| 354 void* RegExpUnparser::VisitLookahead(RegExpLookahead* that, void* data) { | 354 void* RegExpUnparser::VisitLookahead(RegExpLookahead* that, void* data) { |
| 355 stream()->Add("(-> "); | 355 stream()->Add("(-> "); |
| 356 stream()->Add(that->is_positive() ? "+ " : "- "); | 356 stream()->Add(that->is_positive() ? "+ " : "- "); |
| 357 that->body()->Accept(this, data); | 357 that->body()->Accept(this, data); |
| 358 stream()->Add(")"); | 358 stream()->Add(")"); |
| 359 return NULL; | 359 return NULL; |
| 360 } | 360 } |
| 361 | 361 |
| 362 | 362 |
| 363 void* RegExpUnparser::VisitBackreference(RegExpBackreference* that, | 363 void* RegExpUnparser::VisitBackReference(RegExpBackReference* that, |
| 364 void* data) { | 364 void* data) { |
| 365 stream()->Add("(<- %i)", that->index()); | 365 stream()->Add("(<- %i)", that->index()); |
| 366 return NULL; | 366 return NULL; |
| 367 } | 367 } |
| 368 | 368 |
| 369 | 369 |
| 370 void* RegExpUnparser::VisitEmpty(RegExpEmpty* that, void* data) { | 370 void* RegExpUnparser::VisitEmpty(RegExpEmpty* that, void* data) { |
| 371 stream()->Put('%'); | 371 stream()->Put('%'); |
| 372 return NULL; | 372 return NULL; |
| 373 } | 373 } |
| 374 | 374 |
| 375 | 375 |
| 376 SmartPointer<const char> RegExpTree::ToString() { | 376 SmartPointer<const char> RegExpTree::ToString() { |
| 377 RegExpUnparser unparser; | 377 RegExpUnparser unparser; |
| 378 Accept(&unparser, NULL); | 378 Accept(&unparser, NULL); |
| 379 return unparser.ToString(); | 379 return unparser.ToString(); |
| 380 } | 380 } |
| 381 | 381 |
| 382 | 382 |
| 383 } } // namespace v8::internal | 383 } } // namespace v8::internal |
| OLD | NEW |