http://codereview.chromium.org/9638/diff/1/2 File src/ast.h (right):
http://codereview.chromium.org/9638/diff/1/2#newcode1216 Line 1216: virtual RegExpNode* ToNode(RegExpCompiler* compiler, It used to be but when I wanted to add the on_failure argument it became unmanageable. http://codereview.chromium.org/9638/diff/1/4 File src/jsregexp.cc (right): http://codereview.chromium.org/9638/diff/1/4#newcode1057 Line 1057: // Good points all -- I'm just adding TODOs for now. http://codereview.chromium.org/9638/diff/1/4#newcode1061 Line 1061: int reg = needs_counter ? compiler->AllocateRegister() : -1; Yes. My idea was to add a few transformations at parse time to turn <x>? into (?:|<x>) and <x>+ into <x><x>*. http://codereview.chromium.org/9638/diff/1/4#newcode1121 Line 1121: RegExpNode* proceed = ActionNode::EndSubmatch(on_success); This is based on a long discussion I had with Erik and we're pretty confident that this matches the specified semantics though something simpler may also work. What sets lookahead apart from other expressions (well, one of the things) is that you're not allowed to backtrack into lookahead once you've completed it; it's on page 139 in the spec. In the positive case (and the negative is the same in principle) you may use backtracking as part of matching the lookahead itself, but once you've found a match you have to clear any pending backtracks that were set up to avoid backtracking back into the lookahead again later. That's what a submatch does: basically sets up a "scope" where you can push any number of backtracks you want but if the need arises you can zap them all in one go using EscapeSubmatch. http://codereview.chromium.org/9638 --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
