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

added constructor generation #121

Merged
merged 2 commits into from
Jan 29, 2025
Merged

Conversation

qoxrdw
Copy link
Contributor

@qoxrdw qoxrdw commented Jan 27, 2025

added constructor generation
also added a new puzzle for it
PR for issue #15

Copy link
Owner

@volodya-lombrozo volodya-lombrozo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qoxrdw Thank you for the contribution! Just a few small comments.

;

constructorBody
: '{' '}'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qoxrdw Can we use methodBlock instead of constructorBody here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we can use it if we want the constructor body not to be empty. I'll add this.

classBody /* $jsmith-scope */
: '{' classBodyDeclaration+ '}' NL
: '{' constructorDeclaration classBodyDeclaration+'}' NL
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qoxrdw Class might be without a constructor. Maybe we can make constuctorDeclaration optional? What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree, I'll add this.

Copy link
Owner

@volodya-lombrozo volodya-lombrozo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qoxrdw Looks good to me. Thanks

@volodya-lombrozo
Copy link
Owner

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Jan 29, 2025

@rultor merge

@volodya-lombrozo OK, I'll try to merge now. You can check the progress of the merge here.

@rultor rultor merged commit 6bdbc16 into volodya-lombrozo:main Jan 29, 2025
8 checks passed
@rultor
Copy link
Collaborator

rultor commented Jan 29, 2025

@rultor merge

@volodya-lombrozo Done! FYI, the full log is here (took me 4min).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants