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

Makes class definiens be the constructor instead of the class body #375

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4629,11 +4629,19 @@ inherit .return_or_yield
;; These rules are all about declarations and terms that have the names
;; directly in them.

(class_declaration
name:(_)@name
body:(_)@_body)@class_decl {
(
(class_declaration
name:(_)@name
body:(class_body
(method_definition
name:(_)@name)@constructor
)
)

(#eq? @name "constructor")
) {

attr (@name.pop) definiens_node = @class_decl
attr (@name.pop) definiens_node = @constructor

}

Expand Down Expand Up @@ -4680,11 +4688,19 @@ inherit .return_or_yield

}

(class
name:(_)@name
body:(_)@_body)@class {
(
(class
name:(_)@name
body:(class_body
(method_definition
name:(_)@name)@constructor
)
)

attr (@name.pop) definiens_node = @class
(#eq? @name "constructor")
) {

attr (@name.pop) definiens_node = @constructor

}

Expand Down