Skip to content

Commit

Permalink
feat: Support ES2025 and RegExp duplicate named capturing groups (#608)
Browse files Browse the repository at this point in the history
* feat: Support ES2025 and RegExp duplicate named capturing groups

* update readme

* Update README.md

Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>

---------

Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
  • Loading branch information
ota-meshi and mdjermanovic authored Jun 17, 2024
1 parent 821b331 commit 3059713
Show file tree
Hide file tree
Showing 13 changed files with 433 additions and 10 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ const options = {
// create a top-level tokens array containing all tokens
tokens: false,

// Set to 3, 5 (the default), 6, 7, 8, 9, 10, 11, 12, 13, 14 or 15 to specify the version of ECMAScript syntax you want to use.
// You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), 2021 (same as 12), 2022 (same as 13), 2023 (same as 14) or 2024 (same as 15) to use the year-based naming.
// Set to 3, 5 (the default), 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 or 16 to specify the version of ECMAScript syntax you want to use.
// You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), 2021 (same as 12), 2022 (same as 13), 2023 (same as 14), 2024 (same as 15) or 2025 (same as 16) to use the year-based naming.
// You can also set "latest" to use the most recently supported version.
ecmaVersion: 3,

Expand Down Expand Up @@ -231,11 +231,11 @@ We are building on top of Acorn, however, so that we can contribute back and hel

### What ECMAScript features do you support?

Espree supports all ECMAScript 2023 features and partially supports ECMAScript 2024 features.
Espree supports all ECMAScript 2024 features and partially supports ECMAScript 2025 features.

Because ECMAScript 2024 is still under development, we are implementing features as they are finalized. Currently, Espree supports:
Because ECMAScript 2025 is still under development, we are implementing features as they are finalized. Currently, Espree supports:

* [RegExp v flag with set notation + properties of strings](https://github.com/tc39/proposal-regexp-v-flag)
* [RegExp Duplicate named capturing groups](https://github.com/tc39/proposal-duplicate-named-capturing-groups)

See [finished-proposals.md](https://github.com/tc39/proposals/blob/master/finished-proposals.md) to know what features are finalized.

Expand Down
3 changes: 2 additions & 1 deletion lib/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ const SUPPORTED_VERSIONS = [
12, // 2021
13, // 2022
14, // 2023
15 // 2024
15, // 2024
16 // 2025
];

/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"funding": "https://opencollective.com/eslint",
"license": "BSD-2-Clause",
"dependencies": {
"acorn": "^8.11.3",
"acorn": "^8.12.0",
"acorn-jsx": "^5.3.2",
"eslint-visitor-keys": "^4.0.0"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
"index": 13,
"lineNumber": 1,
"column": 14,
"message": "Invalid regular expression: /(?<x>a)|(?<x>b)(?<x>c)/: Duplicate capture group name"
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const re1 = /(?<x>a)|(?<x>b)(?<x>c)/;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
"index": 13,
"lineNumber": 1,
"column": 14,
"message": "Invalid regular expression: /(?<x>a)(?:(?<x>b)|(?<x>c))/: Duplicate capture group name"
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const re1 = /(?<x>a)(?:(?<x>b)|(?<x>c))/;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
"index": 13,
"lineNumber": 1,
"column": 14,
"message": "Invalid regular expression: /(?<x>a)(?<x>b)/: Duplicate capture group name"
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const re1 = /(?<x>a)(?<x>b)/;
Loading

0 comments on commit 3059713

Please sign in to comment.