Chromium Code Reviews| Index: src/jsregexp.h |
| diff --git a/src/jsregexp.h b/src/jsregexp.h |
| index 46d53c215e043087ae7fae8f1aac81f364ddb887..60212d4b18bcf4cc10270b9f5a34c9af7c2b541d 100644 |
| --- a/src/jsregexp.h |
| +++ b/src/jsregexp.h |
| @@ -77,7 +77,7 @@ class RegExpImpl { |
| Handle<JSArray> lastMatchInfo); |
| // Prepares a JSRegExp object with Irregexp-specific data. |
| - static void IrregexpPrepare(Handle<JSRegExp> re, |
| + static void IrregexpInitialize(Handle<JSRegExp> re, |
| Handle<String> pattern, |
|
Erik Corry
2010/03/19 11:04:11
indent
Lasse Reichstein
2010/03/19 11:25:42
Done.
|
| JSRegExp::Flags flags, |
| int capture_register_count); |
| @@ -93,6 +93,29 @@ class RegExpImpl { |
| int index, |
| Handle<JSArray> lastMatchInfo); |
| + enum IrregexpResult { RE_FAILURE = 0, RE_SUCCESS = 1, RE_EXCEPTION = -1 }; |
| + |
| + // Prepare a RegExp for being executed one or more times (using |
| + // IrregexpExecOnce) on the subject. |
| + // This ensures that the regexp is compiled for the subject, and that |
| + // the subject is flat. |
| + // Returns the number of integer spaces required by IrregexpExecOnce |
| + // as its "registers" argument. If the regexp cannot be compiled, |
| + // an exeception is thrown, and this function returns negative. |
|
Erik Corry
2010/03/19 11:04:11
Unclear comment. You can't both throw an exceptio
Lasse Reichstein
2010/03/19 11:25:42
Reworded.
|
| + static int IrregexpPrepare(Handle<JSRegExp> regexp, |
| + Handle<String> subject); |
| + |
| + // Execute a regular expression once on the subject, starting from |
| + // character "index". |
| + // If successful, returns RE_SUCCESS and have set the capture positions |
|
Erik Corry
2010/03/19 11:04:11
have -> set
|
| + // in the first registers. |
| + // If matching fails, returns RE_FAILURE. |
| + // If execution fails, throws an exception and returns RE_EXCEPTION. |
|
Erik Corry
2010/03/19 11:04:11
Unclear again.
Lasse Reichstein
2010/03/19 11:25:42
Reworded.
|
| + static IrregexpResult IrregexpExecOnce(Handle<JSRegExp> regexp, |
| + Handle<String> subject, |
| + int index, |
| + Vector<int32_t> registers); |
| + |
| // Execute an Irregexp bytecode pattern. |
| // On a successful match, the result is a JSArray containing |
| // captured positions. On a failure, the result is the null value. |