mirror of
https://github.com/luau-lang/luau.git
synced 2024-11-15 14:25:44 +08:00
d47b2f1dfe
- Type mismatch errors now show detailed information for compound types, highlighting the mismatching component - Fix string.pack bug on ARM when packing negative numbers using unsigned formats - Implement bit32.countlz/countrz (RFC RFC: bit32.countlz/countrz #89) - Minor compiler throughput optimization (~2% faster compilation) - Improve transpiler behavior for edge cases and better test coverage (not exposed through CLI at the moment) - Improve error recovery when parsing invalid assignments - Build fixes for fuzzing targets
32 lines
770 B
C++
32 lines
770 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
|
|
};
|
|
|
|
std::string toString(AstNode* node);
|
|
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{}, bool withTypes = false);
|
|
|
|
} // namespace Luau
|