-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add restrictions on modifiers in local scope
Declarations for functions, classes, and variables are legal at various different scopes (global, type-level, and local), but have different sets of legal modifiers in each. While you might think that would be fine and would simply improve our permissiveness, it actually ends up _restricting_ some valid code - in particular, code that uses those would-be modifiers as identifiers. For instance, one file in Carthage uses the innocent-looking variable name `prefix`, but we fail to parse that because in other scopes, that would instead be a modifier. To fix this, we split out declarations by scope: global, type-level, and local. For now, we treat global and type-level as mostly the same except that subscripts are legal in the latter and not the former. However, for local declarations, we allow a much smaller list of operators. Fixes #39
- Loading branch information
1 parent
4c672b7
commit 64db1fd
Showing
6 changed files
with
284 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.