Prints a parsed AST back to Luau source.
mode = "pretty" (default) formats from AST structure and ignores all token
text and trivia. mode = "preserve" reproduces the original source from the
CST tokens carried on the AST.
@eryx/luau/printer ModuleLuau AST printer.
Two modes, selected by PrintOptions.mode:
leadingText/trailingText) carried on the CST tokens of the AST. It is a
faithful round-trip of whatever tokens are present.text field. It re-derives all whitespace, indentation, and punctuation,
so its output is canonical rather than original.Prints a parsed AST back to Luau source.
mode = "pretty" (default) formats from AST structure and ignores all token
text and trivia. mode = "preserve" reproduces the original source from the
CST tokens carried on the AST.
A ParseResult or AST node.
Print options.
Printed Luau source.