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

Do we allow reserved words/keywords in path components / module names? #73

Open
k2d222 opened this issue Feb 2, 2025 · 2 comments
Open

Comments

@k2d222
Copy link
Contributor

k2d222 commented Feb 2, 2025

WGSL has a bunch of reserved words that could very well be module or folder names: common, external, impl, priv, public, std, type, wgsl to name a few. I would be quite sad if we couldn't make a package named std.

WGSL also has a buch of reserved keywords. For example, Lygia has a WGSL module named const.

Should module names follow the same restrictions as declaration idents?

I don't see any serious downside to this, I vote for.

@k2d222
Copy link
Contributor Author

k2d222 commented Feb 2, 2025

Only the else keyword leads to a LR(1) conflict: if () {} else can be either if() {} else {} or if() {} else::path::to::fn();. Other keywords are fine.

@stefnotch
Copy link
Collaborator

I would follow the ident rules for consistency. Aka disallow everything that is reserved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

2 participants