Skip to content

Commit abef7ed

Browse files
committed
v0.15.10+luau695
1 parent 7284a9c commit abef7ed

File tree

12 files changed

+2006
-47
lines changed

12 files changed

+2006
-47
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "luau0-src"
3-
version = "0.15.9+luau694"
3+
version = "0.15.10+luau695"
44
authors = ["Aleksandr Orlenko <[email protected]>"]
55
edition = "2021"
66
repository = "https://github.com/mlua-rs/luau-src-rs"

luau/Ast/include/Luau/Cst.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
22
#pragma once
33

4+
#include "Luau/Ast.h"
45
#include "Luau/Location.h"
56

67
#include <string>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2+
#pragma once
3+
4+
#include "Luau/Location.h"
5+
#include "Luau/ParseOptions.h"
6+
#include "Luau/ParseResult.h"
7+
8+
#include <string>
9+
10+
namespace Luau
11+
{
12+
class AstNode;
13+
class AstStatBlock;
14+
15+
struct PrettyPrintResult
16+
{
17+
std::string code;
18+
Location errorLocation;
19+
std::string parseError; // Nonempty if the transpile failed
20+
};
21+
22+
std::string toString(AstNode* node);
23+
void dump(AstNode* node);
24+
25+
// Never fails on a well-formed AST
26+
std::string prettyPrint(AstStatBlock& ast);
27+
std::string prettyPrintWithTypes(AstStatBlock& block);
28+
std::string prettyPrintWithTypes(AstStatBlock& block, const CstNodeMap& cstNodeMap);
29+
30+
// Only fails when parsing fails
31+
PrettyPrintResult prettyPrint(std::string_view source, ParseOptions options = ParseOptions{}, bool withTypes = false);
32+
33+
} // namespace Luau

0 commit comments

Comments
 (0)