Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(495)

Side by Side Diff: src/ast.cc

Issue 11350: Add back references. Since "back references" is two words... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/regexp2000/
Patch Set: Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ast.h ('k') | src/bytecodes-re2k.h » ('j') | src/jsregexp.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/bytecodes-re2k.h » ('j') | src/jsregexp.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698