Skip to content

CST: Improve serialization of functions, handle AstTypeFunction#275

Merged
aatxe merged 5 commits intoprimaryfrom
johnny/cst/function-types
May 12, 2025
Merged

CST: Improve serialization of functions, handle AstTypeFunction#275
aatxe merged 5 commits intoprimaryfrom
johnny/cst/function-types

Conversation

@JohnnyMorganz
Copy link
Copy Markdown
Collaborator

This PR introduces support for serializing an AstTypeFunction. The most interesting part of this is the parameters, where the name (and hence colon) is optional. For this, we introduce a type AstTypeFunctionParameter to contain this information. We also serialize the vararg annotation independently.

As part of this, we also extend the serialization on normal functions to include attributes, varargs, and the return type.

For now we serialize a placeholder for the : token (in functions and for AstLocal too), which will get fixed after we sync to Luau 0.673.

@aatxe aatxe merged commit b997df0 into primary May 12, 2025
6 checks passed
@aatxe aatxe deleted the johnny/cst/function-types branch May 12, 2025 21:20
green-real pushed a commit to green-real/lute that referenced this pull request May 19, 2025
…-lang#275)

This PR introduces support for serializing an AstTypeFunction. The most
interesting part of this is the parameters, where the name (and hence
colon) is optional. For this, we introduce a type
`AstTypeFunctionParameter` to contain this information. We also
serialize the vararg annotation independently.

As part of this, we also extend the serialization on normal functions to
include attributes, varargs, and the return type.

For now we serialize a placeholder for the `:` token (in functions and
for AstLocal too), which will get fixed after we sync to Luau 0.673.
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.

2 participants