2021-10-29 21:25:12 +01:00
|
|
|
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
|
|
|
#pragma once
|
|
|
|
|
2024-09-27 19:58:21 +01:00
|
|
|
#include "Luau/Ast.h"
|
|
|
|
#include "Luau/DenseHash.h"
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
2021-10-29 21:25:12 +01:00
|
|
|
namespace Luau
|
|
|
|
{
|
|
|
|
|
|
|
|
enum class Mode
|
|
|
|
{
|
|
|
|
NoCheck, // Do not perform any inference
|
|
|
|
Nonstrict, // Unannotated symbols are any
|
|
|
|
Strict, // Unannotated symbols are inferred
|
|
|
|
Definition, // Type definition module, has special parsing rules
|
|
|
|
};
|
|
|
|
|
2024-09-27 19:58:21 +01:00
|
|
|
struct FragmentParseResumeSettings
|
|
|
|
{
|
|
|
|
DenseHashMap<AstName, AstLocal*> localMap{AstName()};
|
|
|
|
std::vector<AstLocal*> localStack;
|
|
|
|
};
|
|
|
|
|
2021-10-29 21:25:12 +01:00
|
|
|
struct ParseOptions
|
|
|
|
{
|
|
|
|
bool allowDeclarationSyntax = false;
|
|
|
|
bool captureComments = false;
|
2024-09-27 19:58:21 +01:00
|
|
|
std::optional<FragmentParseResumeSettings> parseFragment = std::nullopt;
|
2021-10-29 21:25:12 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Luau
|