- 04 May, 2017 1 commit
-
-
littledan authored
Revert of [regexp] Support unicode capture names in non-unicode patterns (patchset #3 id:40001 of https://codereview.chromium.org/2791163003/ ) Reason for revert: The decision for the specification was to not have this syntax, and instead the syntax before this patch. Original issue's description: > [regexp] Support unicode capture names in non-unicode patterns > > This ensures that capture names containing surrogate pairs are parsed > correctly even in non-unicode RegExp patterns by introducing a new > scanning mode which unconditionally combines surrogate pairs. > > BUG=v8:5437,v8:6192 > > Review-Url: https://codereview.chromium.org/2791163003 > Cr-Commit-Position: refs/heads/master@{#44466} > Committed: https://chromium.googlesource.com/v8/v8/+/a8651c5671dd6e41595ffb438e7ea013082f2d38 R=yangguo@chromium.org,jgruber@chromium.org # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=v8:5437,v8:6192 Review-Url: https://codereview.chromium.org/2859933003 Cr-Commit-Position: refs/heads/master@{#45088}
-
- 25 Apr, 2017 1 commit
-
-
jgruber authored
Some of these tests pass the pattern as a string, and in this case there's a subtle distinction between "/\u{0041}/" // Unicode escape interpreted in string literal. and "/\\u{0041}/" // Unicode escape interpreted by regexp parser. Extend these tests to check both cases. Thanks littledan@ for pointing this out. BUG=v8:5437 Review-Url: https://codereview.chromium.org/2839923002 Cr-Commit-Position: refs/heads/master@{#44840}
-
- 07 Apr, 2017 3 commits
-
-
jgruber authored
Update docs and tests for recent changes in the spec for unicode escapes in capture group names. https://github.com/tc39/proposal-regexp-named-groups/issues/23 BUG=v8:5437 Review-Url: https://codereview.chromium.org/2788423003 Cr-Commit-Position: refs/heads/master@{#44474}
-
jgruber authored
References to invalid names (i.e. not specified as a named group in the pattern) throw a SyntaxError. Unmatched groups are still replaced by the empty string. See https://github.com/tc39/proposal-regexp-named-groups/issues/14. BUG=v8:5437 Review-Url: https://codereview.chromium.org/2791183002 Cr-Commit-Position: refs/heads/master@{#44471}
-
jgruber authored
This ensures that capture names containing surrogate pairs are parsed correctly even in non-unicode RegExp patterns by introducing a new scanning mode which unconditionally combines surrogate pairs. BUG=v8:5437,v8:6192 Review-Url: https://codereview.chromium.org/2791163003 Cr-Commit-Position: refs/heads/master@{#44466}
-
- 05 Apr, 2017 1 commit
-
-
jgruber authored
IdentifierStart::Is and IdentifierContinue::Is both return true for '\'. The reason for this is lost to history. Special-case '\' in the regexp parser to handle this. BUG=v8:5437,v8:5868 Review-Url: https://codereview.chromium.org/2795093003 Cr-Commit-Position: refs/heads/master@{#44396}
-
- 03 Apr, 2017 1 commit
-
-
jgruber authored
Previously, named captures (and related functionality) were restricted to unicode-mode regexps. This CL extends that support to non-unicode patterns. Named groups are supported regardless of the mode, and named back-references are supported if the regexp is in unicode mode or if it contains a named capture (otherwise '\k' is treated as an identity escape). BUG=v8:5437,v8:6192 Review-Url: https://codereview.chromium.org/2788873002 Cr-Commit-Position: refs/heads/master@{#44324}
-
- 31 Mar, 2017 2 commits
-
-
jgruber authored
Numbered back-references that occur before the referenced capture trigger an internal mini-parser that looks ahead in the pattern and counts capturing groups. This updates the mini-parser to correctly handle named captures. BUG=v8:5437 Review-Url: https://codereview.chromium.org/2792523002 Cr-Commit-Position: refs/heads/master@{#44303}
-
jgruber authored
Additional tests, mostly for interactions with lookbehind assertions. BUG=v8:5437 Review-Url: https://codereview.chromium.org/2784813002 Cr-Commit-Position: refs/heads/master@{#44290}
-
- 28 Mar, 2017 4 commits
-
-
jgruber authored
BUG=v8:5437 Review-Url: https://codereview.chromium.org/2776263003 Cr-Commit-Position: refs/heads/master@{#44194}
-
jgruber authored
This implements support for named captures in RegExp.prototype[@@replace] for when the replaceValue is not callable. Named captures can be referenced from replacement strings by using the "$<name>" syntax. A couple of examples: let re = /(?<fst>.)(?<snd>.)/u; "abcd".replace(re, "$<snd>$<fst>") // "bacd" "abcd".replace(re, "$2$1") // "bacd" (numbered refs work as always) "abcd".replace(re, "$<snd") // SyntaxError (unterminated named ref) "abcd".replace(re, "$<42$1>") // "cd" (invalid name) "abcd".replace(re, "$<thd>") // "cd" (non-existent name) "abcd".replace(/(?<fst>.)|(?<snd>.)/u, "$<snd>") // "cd" (non-matched capture) Support is currently behind the --harmony-regexp-named-captures flag. BUG=v8:5437 Review-Url: https://codereview.chromium.org/2775303002 Cr-Original-Commit-Position: refs/heads/master@{#44171} Committed: https://chromium.googlesource.com/v8/v8/+/17f13863b64b25eccf565e0aa9c4c441f0562b84 Review-Url: https://codereview.chromium.org/2775303002 Cr-Commit-Position: refs/heads/master@{#44182}
-
jgruber authored
Revert of [regexp] Named capture support for string replacements (patchset #5 id:80001 of https://codereview.chromium.org/2775303002/ ) Reason for revert: Invalid DCHECKs for non-matched groups. Original issue's description: > [regexp] Named capture support for string replacements > > This implements support for named captures in > RegExp.prototype[@@replace] for when the replaceValue is not callable. > > Named captures can be referenced from replacement strings by using the > "$<name>" syntax. A couple of examples: > > let re = /(?<fst>.)(?<snd>.)/u; > "abcd".replace(re, "$<snd>$<fst>") // "bacd" > "abcd".replace(re, "$2$1") // "bacd" (numbered refs work as always) > "abcd".replace(re, "$<snd") // SyntaxError (unterminated named ref) > "abcd".replace(re, "$<42$1>") // "cd" (invalid name) > "abcd".replace(re, "$<thd>") // "cd" (non-existent name) > "abcd".replace(/(?<fst>.)|(?<snd>.)/u, "$<snd>") // "cd" (non-matched capture) > > Support is currently behind the --harmony-regexp-named-captures flag. > > BUG=v8:5437 > > Review-Url: https://codereview.chromium.org/2775303002 > Cr-Commit-Position: refs/heads/master@{#44171} > Committed: https://chromium.googlesource.com/v8/v8/+/17f13863b64b25eccf565e0aa9c4c441f0562b84 TBR=yangguo@chromium.org,littledan@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=v8:5437 Review-Url: https://codereview.chromium.org/2776293003 Cr-Commit-Position: refs/heads/master@{#44180}
-
jgruber authored
This implements support for named captures in RegExp.prototype[@@replace] for when the replaceValue is not callable. Named captures can be referenced from replacement strings by using the "$<name>" syntax. A couple of examples: let re = /(?<fst>.)(?<snd>.)/u; "abcd".replace(re, "$<snd>$<fst>") // "bacd" "abcd".replace(re, "$2$1") // "bacd" (numbered refs work as always) "abcd".replace(re, "$<snd") // SyntaxError (unterminated named ref) "abcd".replace(re, "$<42$1>") // "cd" (invalid name) "abcd".replace(re, "$<thd>") // "cd" (non-existent name) "abcd".replace(/(?<fst>.)|(?<snd>.)/u, "$<snd>") // "cd" (non-matched capture) Support is currently behind the --harmony-regexp-named-captures flag. BUG=v8:5437 Review-Url: https://codereview.chromium.org/2775303002 Cr-Commit-Position: refs/heads/master@{#44171}
-
- 27 Mar, 2017 1 commit
-
-
jgruber authored
This implements support for named captures in RegExp.prototype[@@replace] for when the replaceValue is callable. In that case, the result.groups object is passed to the replacer function as the last argument. BUG=v8:5437 Review-Url: https://codereview.chromium.org/2764343004 Cr-Commit-Position: refs/heads/master@{#44142}
-
- 23 Mar, 2017 1 commit
-
-
jgruber authored
This is just an update to reflect the current spec proposal. https://tc39.github.io/proposal-regexp-named-groups/ BUG=v8:5437 Review-Url: https://codereview.chromium.org/2769143002 Cr-Commit-Position: refs/heads/master@{#44067}
-
- 01 Feb, 2017 1 commit
-
-
jgruber authored
This implements storing named captures on the regexp result object. For instance, /(?<a>.)/u.exec("b") will return a result such that: result.group.a // "b" https://tc39.github.io/proposal-regexp-named-groups/ BUG=v8:5437 Review-Url: https://codereview.chromium.org/2630233003 Cr-Original-Original-Original-Commit-Position: refs/heads/master@{#42532} Committed: https://chromium.googlesource.com/v8/v8/+/70000946eb2a9155679528702a766219a1fcf154 Review-Url: https://codereview.chromium.org/2630233003 Cr-Original-Original-Commit-Position: refs/heads/master@{#42570} Committed: https://chromium.googlesource.com/v8/v8/+/ee94fa11ed63477393c6534c352ebac6e502396c Review-Url: https://codereview.chromium.org/2630233003 Cr-Original-Commit-Position: refs/heads/master@{#42676} Committed: https://chromium.googlesource.com/v8/v8/+/8bf52534f6bf86821a1589dcbcb7335052c1f94f Review-Url: https://codereview.chromium.org/2630233003 Cr-Commit-Position: refs/heads/master@{#42838}
-
- 26 Jan, 2017 2 commits
-
-
jgruber authored
Revert of [regexp] Create property on result for each named capture (patchset #9 id:160001 of https://codereview.chromium.org/2630233003/ ) Reason for revert: Some heap tests are broken leading to failures on nosnap builds: https://build.chromium.org/p/client.v8.ports/builders/V8%20Linux%20-%20arm64%20-%20sim%20-%20nosnap%20-%20debug/builds/3677 Reverting again until tests are fixed to keep bots green. Original issue's description: > [regexp] Store named captures on the regexp result > > This implements storing named captures on the regexp result object. > For instance, /(?<a>.)/u.exec("b") will return a result such that: > > result.group.a // "b" > > https://tc39.github.io/proposal-regexp-named-groups/ > > BUG=v8:5437 > > Review-Url: https://codereview.chromium.org/2630233003 > Cr-Original-Original-Commit-Position: refs/heads/master@{#42532} > Committed: https://chromium.googlesource.com/v8/v8/+/70000946eb2a9155679528702a766219a1fcf154 > Review-Url: https://codereview.chromium.org/2630233003 > Cr-Original-Commit-Position: refs/heads/master@{#42570} > Committed: https://chromium.googlesource.com/v8/v8/+/ee94fa11ed63477393c6534c352ebac6e502396c > Review-Url: https://codereview.chromium.org/2630233003 > Cr-Commit-Position: refs/heads/master@{#42676} > Committed: https://chromium.googlesource.com/v8/v8/+/8bf52534f6bf86821a1589dcbcb7335052c1f94f TBR=yangguo@chromium.org,littledan@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=v8:5437 Review-Url: https://codereview.chromium.org/2654233002 Cr-Commit-Position: refs/heads/master@{#42681}
-
jgruber authored
This implements storing named captures on the regexp result object. For instance, /(?<a>.)/u.exec("b") will return a result such that: result.group.a // "b" https://tc39.github.io/proposal-regexp-named-groups/ BUG=v8:5437 Review-Url: https://codereview.chromium.org/2630233003 Cr-Original-Original-Commit-Position: refs/heads/master@{#42532} Committed: https://chromium.googlesource.com/v8/v8/+/70000946eb2a9155679528702a766219a1fcf154 Review-Url: https://codereview.chromium.org/2630233003 Cr-Original-Commit-Position: refs/heads/master@{#42570} Committed: https://chromium.googlesource.com/v8/v8/+/ee94fa11ed63477393c6534c352ebac6e502396c Review-Url: https://codereview.chromium.org/2630233003 Cr-Commit-Position: refs/heads/master@{#42676}
-
- 20 Jan, 2017 4 commits
-
-
jgruber authored
Revert of [regexp] Create property on result for each named capture (patchset #7 id:120001 of https://codereview.chromium.org/2630233003/ ) Reason for revert: Breaks arm64. Original issue's description: > [regexp] Store named captures on the regexp result > > This implements storing named captures on the regexp result object. > For instance, /(?<a>.)/u.exec("b") will return a result such that: > > result.group.a // "b" > > The spec proposal is not yet final, so this may still change in the future. > > BUG=v8:5437 > > Review-Url: https://codereview.chromium.org/2630233003 > Cr-Original-Commit-Position: refs/heads/master@{#42532} > Committed: https://chromium.googlesource.com/v8/v8/+/70000946eb2a9155679528702a766219a1fcf154 > Review-Url: https://codereview.chromium.org/2630233003 > Cr-Commit-Position: refs/heads/master@{#42570} > Committed: https://chromium.googlesource.com/v8/v8/+/ee94fa11ed63477393c6534c352ebac6e502396c TBR=yangguo@chromium.org,littledan@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=v8:5437 Review-Url: https://codereview.chromium.org/2639403008 Cr-Commit-Position: refs/heads/master@{#42577}
-
jgruber authored
This implements storing named captures on the regexp result object. For instance, /(?<a>.)/u.exec("b") will return a result such that: result.group.a // "b" The spec proposal is not yet final, so this may still change in the future. BUG=v8:5437 Review-Url: https://codereview.chromium.org/2630233003 Cr-Original-Commit-Position: refs/heads/master@{#42532} Committed: https://chromium.googlesource.com/v8/v8/+/70000946eb2a9155679528702a766219a1fcf154 Review-Url: https://codereview.chromium.org/2630233003 Cr-Commit-Position: refs/heads/master@{#42570}
-
jgruber authored
Revert of [regexp] Create property on result for each named capture (patchset #5 id:80001 of https://codereview.chromium.org/2630233003/ ) Reason for revert: Breaks no18n build: https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20noi18n%20-%20debug/builds/11604 Original issue's description: > [regexp] Store named captures on the regexp result > > This implements storing named captures on the regexp result object. > For instance, /(?<a>.)/u.exec("b") will return a result such that: > > result.group.a // "b" > > The spec proposal is not yet final, so this may still change in the future. > > BUG=v8:5437 > > Review-Url: https://codereview.chromium.org/2630233003 > Cr-Commit-Position: refs/heads/master@{#42532} > Committed: https://chromium.googlesource.com/v8/v8/+/70000946eb2a9155679528702a766219a1fcf154 TBR=yangguo@chromium.org,littledan@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=v8:5437 Review-Url: https://codereview.chromium.org/2643213002 Cr-Commit-Position: refs/heads/master@{#42534}
-
jgruber authored
This implements storing named captures on the regexp result object. For instance, /(?<a>.)/u.exec("b") will return a result such that: result.group.a // "b" The spec proposal is not yet final, so this may still change in the future. BUG=v8:5437 Review-Url: https://codereview.chromium.org/2630233003 Cr-Commit-Position: refs/heads/master@{#42532}
-
- 15 Jun, 2016 1 commit
-
-
jgruber authored
Named capture groups may be specified using the /(?<name>pattern)/u syntax, with named backreferences specified as /\k<name>/u. They're hidden behind the --harmony-regexp-named-captures flag, and are only enabled for unicode regexps. R=yangguo@chromium.org BUG= Review-Url: https://codereview.chromium.org/2050343002 Cr-Commit-Position: refs/heads/master@{#36986}
-