You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cf580f1
Browse filesBrowse the repository at this point in the historyBrowse files
Reject a namespace that is not a valid module name
Why:
A namespace becomes a module, but a package named "_" or "123" with
"namespace": true, or a "namespace" value such as "_ns", yielded a name
no ReScript code can refer to. Both build systems now reject it when
loading rescript.json, for the root package and every dependency.
Diagnostic added (invalid namespace):
Example:
{"name": "_", "namespace": true}
After (diagnostic):
/path/to/rescript.json: namespace "_" derived from package name "_" is not a valid module name; set "namespace" to a valid module name or rename the package
A valid module name is what the scanner reads as an upper-case identifier:
an ASCII capital, then letters, digits, '_', '\'' and '$'. Packages without
a namespace keep accepting any name, including "_".
Review: Why not reserve the package name "_" as bsb did? bsb reserved it
only because the compiler used "_" as an internal "no package" sentinel,
which a variant replaced in 2019 (8ed242a).
Review: What else is now rejected? "namespace": "" (an empty namespace
module), which the parity table listed as accepted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kr4cjoUi2f5VpMvE6wT9bo
Signed-off-by: Christoph Knittel <ck@cca.io>
0 commit comments