Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we have some position information in Unbalanced delimiter error? #293

Closed
3cp opened this issue May 15, 2020 · 1 comment · Fixed by #321
Closed

Can we have some position information in Unbalanced delimiter error? #293

3cp opened this issue May 15, 2020 · 1 comment · Fixed by #321

Comments

@3cp
Copy link

3cp commented May 15, 2020

Related to #96

I wonder is it possible to add position information to the error message?

Unbalanced delimiter found in string
    at Function.XRegExp.matchRecursive (node_modules/xregexp/lib/addons/matchrecursive.js:211:15)

Something like

Unbalanced delimiter found in string, for left delimiter at position 123

So that it's easier for user to find out where is the problem in the input string.

@slevithan
Copy link
Owner

Great suggestion! PRs welcome. :)

josephfrazier added a commit that referenced this issue Feb 7, 2021
Changes include:

* BREAKING: Handle ES2018 capture names: #247
* BREAKING: Enable `namespacing` feature by default: #316
* BREAKING: Remove Unicode Blocks addon: 4860122
* restore perf tweak that made a meaningful difference in regex construction perf tests: 5f18261
* XRegExp.exec: preserve groups obj that comes from native ES2018 named capture: c4a83e7
* Make XRegExp.exec set groups prop to undefined if there are no named captures (closes #320): 7fea476
* Support optional 'Script=' prefix (from ES2018 syntax) for Unicode script tokens (#225): bb35ead
* XRegExp.matchRecursive: Add delimiter and pos info when unbalanced delimiters are found (closes #293): 9660b90
* XRegExp.escape: Escape whitespace in a way that works with ES6 flag u (fixes #197): e22a52b

To generate this commit, I adapted the steps at #205 (comment)

Here's a fuller list of changes that can be needed with new releases:

> * Version number
>   * Update version number and year in headers, config files, README.
>   * Update version number in `XRegExp.version`.
> * Publish
>   * Publish new git tag. E.g.:
>     * `git tag -a v3.1.0 -m "Release 3.1.0"`.
>     * `git push origin v3.1.0`.
>   * `npm publish`.
josephfrazier added a commit that referenced this issue Feb 8, 2021
Changes include:

* BREAKING: Handle ES2018 capture names: #247
* BREAKING: Enable `namespacing` feature by default: #316
* BREAKING: Remove Unicode Blocks addon: 4860122
* restore perf tweak that made a meaningful difference in regex construction perf tests: 5f18261
* XRegExp.exec: preserve groups obj that comes from native ES2018 named capture: c4a83e7
* Make XRegExp.exec set groups prop to undefined if there are no named captures (closes #320): 7fea476
* Support optional 'Script=' prefix (from ES2018 syntax) for Unicode script tokens (#225): bb35ead
* XRegExp.matchRecursive: Add delimiter and pos info when unbalanced delimiters are found (closes #293): 9660b90
* XRegExp.escape: Escape whitespace in a way that works with ES6 flag u (fixes #197): e22a52b

To generate this commit, I adapted the steps at #205 (comment)

Here's a fuller list of changes that can be needed with new releases:

> * Version number
>   * Update version number and year in headers, config files, README.
>   * Update version number in `XRegExp.version`.
> * Publish
>   * Publish new git tag. E.g.:
>     * `git tag -a v3.1.0 -m "Release 3.1.0"`.
>     * `git push origin v3.1.0`.
>   * `npm publish`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants