tc39 / proposal-source-phase-imports

Proposal to enable importing modules at the source phase
https://tc39.es/proposal-source-phase-imports/
MIT License
132 stars 8 forks source link

Disallow newlines between phase and identifier #41

Closed lucacasonato closed 1 year ago

lucacasonato commented 1 year ago

There is a cross cutting concern with module declarations:

module source {}
import source
x
from
"url"

Here it is ambiguous whether this is:

module source {}
import source;
x;
from;
"url";

or

import source x from "url";

We should disambiguate by banning newlines after <phase> in the static syntax.

Thanks @hax for reporting!

lucacasonato commented 1 year ago

@waldemarhorwat You may be interested in this issue too.