mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
8ffb4ef78a
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: RyanCavanaugh <[email protected]> Co-authored-by: Ryan Cavanaugh <[email protected]>
42 lines
1.4 KiB
TypeScript
42 lines
1.4 KiB
TypeScript
//// [tests/cases/compiler/regexNamedGroupDuplicateNestedInGroup.ts] ////
|
|
|
|
//// [regexNamedGroupDuplicateNestedInGroup.ts]
|
|
// Duplicate at the top level (already reported prior to this fix).
|
|
/(?<a>x)(?<a>y)/;
|
|
|
|
// Earlier definition nested inside a non-capturing group.
|
|
/(?:(?<a>x))(?<a>z)/;
|
|
|
|
// Earlier definition nested inside a non-capturing group with alternation.
|
|
/(?:(?<a>x)|y)(?<a>z)/;
|
|
|
|
// Earlier definition nested inside a lookahead assertion.
|
|
/(?=(?<a>x))(?<a>z)/;
|
|
|
|
// Earlier definition nested inside a capturing group.
|
|
/((?<a>x))(?<a>z)/;
|
|
|
|
// Legal: duplicate names in different alternatives of the same disjunction.
|
|
/(?<a>x)|(?<a>y)/;
|
|
|
|
// Legal: duplicate names in different alternatives of a nested disjunction.
|
|
/(?:(?<a>x)|(?<a>y))/;
|
|
|
|
|
|
//// [regexNamedGroupDuplicateNestedInGroup.js]
|
|
"use strict";
|
|
// Duplicate at the top level (already reported prior to this fix).
|
|
/(?<a>x)(?<a>y)/;
|
|
// Earlier definition nested inside a non-capturing group.
|
|
/(?:(?<a>x))(?<a>z)/;
|
|
// Earlier definition nested inside a non-capturing group with alternation.
|
|
/(?:(?<a>x)|y)(?<a>z)/;
|
|
// Earlier definition nested inside a lookahead assertion.
|
|
/(?=(?<a>x))(?<a>z)/;
|
|
// Earlier definition nested inside a capturing group.
|
|
/((?<a>x))(?<a>z)/;
|
|
// Legal: duplicate names in different alternatives of the same disjunction.
|
|
/(?<a>x)|(?<a>y)/;
|
|
// Legal: duplicate names in different alternatives of a nested disjunction.
|
|
/(?:(?<a>x)|(?<a>y))/;
|