8000 CST: Add initial support for anonymous functions by JohnnyMorganz · Pull Request #203 · luau-lang/lute · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

CST: Add initial support for anonymous functions #203

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

Merged
merged 2 commits into from
Apr 25, 2025
Merged

Conversation

JohnnyMorganz
Copy link
Collaborator

This PR adds support for serializing function bodies and anonymous functions.

For now, this only includes simple function bodies with no type annotations. We serialize the parentheses, parameters (excluding type specifiers) and end token.

For an anonymous function, we also serialize the function token separately. We create a custom AstExprAnonymousFunction node in the Luau CST to handle this (note that in C++ land this does not exist, it is only an AstExprFunction directly). This new node is added for simplicity.

A follow up change will add serialization of type specifiers and generics in function bodies

Handle parameters in function body

For now, let's ignore the separators
@JohnnyMorganz JohnnyMorganz changed the base branch from johnny/cst/if-stmt to primary April 24, 2025 18:15
@aatxe aatxe enabled auto-merge (squash) April 25, 2025 00:16
@aatxe aatxe merged commit e6c1c2f into primary Apr 25, 2025
6 checks passed
@aatxe aatxe deleted the johnny/cst/functions branch April 25, 2025 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0