-
-
Notifications
You must be signed in to change notification settings - Fork 484
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ast): methods on AST nodes to get
scope_id
etc (#7127)
Add getter and setter methods to all AST types which have a `ScopeId`, `SymbolId` or `ReferenceId` field to get the contents of that field. Before: ```rs let symbol_id = ident.symbol_id.get().unwrap(); ``` After: ```rs let symbol_id = ident.symbol_id(); ``` This allows removing boilerplate code from the transformer, and discouraging the anti-pattern of treating these fields as if they may contain either `Some` or `None` (after semantic, they will always be `Some`).
- Loading branch information
1 parent
843bce4
commit cc8a191
Showing
7 changed files
with
524 additions
and
18 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
Oops, something went wrong.