mirror of
https://github.com/luau-lang/luau.git
synced 2024-11-15 22:35:43 +08:00
d01addc625
Co-authored-by: Rodactor <rodactor@roblox.com>
31 lines
709 B
C++
31 lines
709 B
C++
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
|
#pragma once
|
|
|
|
#include "Luau/Location.h"
|
|
#include "Luau/ParseOptions.h"
|
|
|
|
#include <string>
|
|
|
|
namespace Luau
|
|
{
|
|
class AstNode;
|
|
class AstStatBlock;
|
|
|
|
struct TranspileResult
|
|
{
|
|
std::string code;
|
|
Location errorLocation;
|
|
std::string parseError; // Nonempty if the transpile failed
|
|
};
|
|
|
|
void dump(AstNode* node);
|
|
|
|
// Never fails on a well-formed AST
|
|
std::string transpile(AstStatBlock& ast);
|
|
std::string transpileWithTypes(AstStatBlock& block);
|
|
|
|
// Only fails when parsing fails
|
|
TranspileResult transpile(std::string_view source, ParseOptions options = ParseOptions{});
|
|
|
|
} // namespace Luau
|