Carpet

Carpet

2M Downloads

[Scarpet] Allow "global_" variable prefix to be capitalized

Arian04 opened this issue ยท 0 comments

commented

Right now, variables are only considered global if they start with global_. I think it would be really nice if this was case insensitive, or at least if GLOBAL_ was valid as well, because it would make declaring global constants much cleaner in my opinion (global_SOME_CONSTANT vs GLOBAL_SOME_CONSTANT).

This isn't really anything major though. I would've submitted a pull request to change this but I wanted to know if you guys even approved of this change (like whether or not it's good language design). From quickly searching through the codebase, I think this change would mostly just be changing some .startsWith("global_")s to .toLowerCase().startsWith("global_")s (or a second check if you want only all lowercase and all uppercase global_ to be valid) as well as changes in the docs.

Side note: loving scarpet, thanks for making this, it's amazing!