Skip to content

Always exclude dyn import attributes from specifier range#197

Merged
guybedford merged 2 commits into
guybedford:mainfrom
nicolo-ribaudo:dynamic-import-expr-specifier
Apr 25, 2026
Merged

Always exclude dyn import attributes from specifier range#197
guybedford merged 2 commits into
guybedford:mainfrom
nicolo-ribaudo:dynamic-import-expr-specifier

Conversation

@nicolo-ribaudo

@nicolo-ribaudo nicolo-ribaudo commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

Fixes #196

Comment thread src/lexer.c
Comment thread src/lexer.h
@nicolo-ribaudo nicolo-ribaudo force-pushed the dynamic-import-expr-specifier branch from 5afd337 to 7553ca6 Compare April 21, 2026 15:52
- restore main-loop position after the comma handler advances past
  the separator (otherwise the first attribute character is skipped,
  breaking import(foo, { ... }), import(foo, [...]), etc.)
- mirror the [/]/, handling and JS port in lexer.js
- drop the stale 'Paren = odd, Brace = even' comment (no code relies
  on the parity, and AnyBracket = 8 already breaks it)
- add tests for object/array/string/template/paren attribute forms,
  comments before the attributes argument, and parenthesized comma
  expressions as the specifier (import((a, b)), import((a, b), attrs))
@guybedford

Copy link
Copy Markdown
Owner

Pushed some extra test cases.

@guybedford guybedford merged commit 4a35138 into guybedford:main Apr 25, 2026
@guybedford

Copy link
Copy Markdown
Owner

Released in 2.1.0.

mergify Bot added a commit to ArcadeData/arcadedb that referenced this pull request Apr 26, 2026
…2.1.0 in /studio [skip ci]

Bumps [es-module-lexer](https://github.com/guybedford/es-module-lexer) from 2.0.0 to 2.1.0.
Release notes

*Sourced from [es-module-lexer's releases](https://github.com/guybedford/es-module-lexer/releases).*

> 2.1.0
> -----
>
> What's Changed
> --------------
>
> * Always exclude dyn import attributes from specifier range by [`@​nicolo-ribaudo`](https://github.com/nicolo-ribaudo) in [guybedford/es-module-lexer#197](https://redirect.github.com/guybedford/es-module-lexer/pull/197)
> * fix: handle new of conflict cases by [`@​guybedford`](https://github.com/guybedford) in [guybedford/es-module-lexer#195](https://redirect.github.com/guybedford/es-module-lexer/pull/195)
>
> New Contributors
> ----------------
>
> * [`@​nicolo-ribaudo`](https://github.com/nicolo-ribaudo) made their first contribution in [guybedford/es-module-lexer#197](https://redirect.github.com/guybedford/es-module-lexer/pull/197)
>
> **Full Changelog**: <guybedford/es-module-lexer@2.0.0...2.1.0>


Commits

* [`5fb11e1`](guybedford/es-module-lexer@5fb11e1) 2.1.0
* [`cc29c5b`](guybedford/es-module-lexer@cc29c5b) fix: handle new of conflict cases ([#195](https://redirect.github.com/guybedford/es-module-lexer/issues/195))
* [`4a35138`](guybedford/es-module-lexer@4a35138) Always exclude dyn import attributes from specifier range ([#197](https://redirect.github.com/guybedford/es-module-lexer/issues/197))
* See full diff in [compare view](guybedford/es-module-lexer@2.0.0...2.1.0)
  
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility\_score?dependency-name=es-module-lexer&package-manager=npm\_and\_yarn&previous-version=2.0.0&new-version=2.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
  
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
@nicolo-ribaudo nicolo-ribaudo deleted the dynamic-import-expr-specifier branch May 5, 2026 17:23
tae898 pushed a commit to humemai/arcadedb-embedded-python that referenced this pull request Jun 28, 2026
…2.1.0 in /studio [skip ci]

Bumps [es-module-lexer](https://github.com/guybedford/es-module-lexer) from 2.0.0 to 2.1.0.
Release notes

*Sourced from [es-module-lexer's releases](https://github.com/guybedford/es-module-lexer/releases).*

> 2.1.0
> -----
>
> What's Changed
> --------------
>
> * Always exclude dyn import attributes from specifier range by [`@​nicolo-ribaudo`](https://github.com/nicolo-ribaudo) in [guybedford/es-module-lexer#197](https://redirect.github.com/guybedford/es-module-lexer/pull/197)
> * fix: handle new of conflict cases by [`@​guybedford`](https://github.com/guybedford) in [guybedford/es-module-lexer#195](https://redirect.github.com/guybedford/es-module-lexer/pull/195)
>
> New Contributors
> ----------------
>
> * [`@​nicolo-ribaudo`](https://github.com/nicolo-ribaudo) made their first contribution in [guybedford/es-module-lexer#197](https://redirect.github.com/guybedford/es-module-lexer/pull/197)
>
> **Full Changelog**: <guybedford/es-module-lexer@2.0.0...2.1.0>


Commits

* [`5fb11e1`](guybedford/es-module-lexer@5fb11e1) 2.1.0
* [`cc29c5b`](guybedford/es-module-lexer@cc29c5b) fix: handle new of conflict cases ([ArcadeData#195](https://redirect.github.com/guybedford/es-module-lexer/issues/195))
* [`4a35138`](guybedford/es-module-lexer@4a35138) Always exclude dyn import attributes from specifier range ([ArcadeData#197](https://redirect.github.com/guybedford/es-module-lexer/issues/197))
* See full diff in [compare view](guybedford/es-module-lexer@2.0.0...2.1.0)
  
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility\_score?dependency-name=es-module-lexer&package-manager=npm\_and\_yarn&previous-version=2.0.0&new-version=2.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
  
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dynamic import specifier position includes attributes when using a non-string specifier

2 participants