This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 660
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(rslint_parser): Change MemberExpression AST structure (#1799)
Refactors the AST tree structure for MemberExpressions as part of #1725 * Renames `BracketExpr` to `JsComputedMemberExpression` * Renames `DotExpr` to `JsStaticMemberExpression` * Introduces the new `JsReferenceIdentifierMember` and `JsReferencePrivateMember` which are references to member names (analog to `JsReferenceIdentifierExpression` that references an identifier and `JsBindingIdentifier` that defines an identifier) * Merge `PrivatePropAccess` into `JsStaticMemberExpression` (enabled by introducing `JsReferenceMember` * Introduce `SuperExpression` so that `super.test()` works * Add new check that verifies that calling `super()` only works inside of constructor (I leave checking if we're inside of a subclass to another PR). * Delete `SuperCall` as this can now be modelled using `CallExpr` * Deleted some no longer used nodes/kinds
- Loading branch information
1 parent
a9aa8dc
commit d0b9b60
Showing
45 changed files
with
789 additions
and
500 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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
use crate::{FormatElement, FormatResult, Formatter, ToFormatElement}; | ||
use rslint_parser::ast::JsSuperExpression; | ||
|
||
impl ToFormatElement for JsSuperExpression { | ||
fn to_format_element(&self, formatter: &Formatter) -> FormatResult<FormatElement> { | ||
formatter.format_token(&self.super_token()?) | ||
} | ||
} |
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.