Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Roblox
GitHub Repository: Roblox/luau
Path: blob/master/Ast/include/Luau/ParseOptions.h
2727 views
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/Ast.h"
5
#include "Luau/DenseHash.h"
6
7
#include <vector>
8
9
namespace Luau
10
{
11
12
enum class Mode
13
{
14
NoCheck, // Do not perform any inference
15
Nonstrict, // Unannotated symbols are any
16
Strict, // Unannotated symbols are inferred
17
Definition, // Type definition module, has special parsing rules
18
};
19
20
struct FragmentParseResumeSettings
21
{
22
DenseHashMap<AstName, AstLocal*> localMap{AstName()};
23
std::vector<AstLocal*> localStack;
24
Position resumePosition;
25
};
26
27
struct ParseOptions
28
{
29
bool allowDeclarationSyntax = false;
30
bool captureComments = false;
31
std::optional<FragmentParseResumeSettings> parseFragment = std::nullopt;
32
bool storeCstData = false;
33
bool noErrorLimit = false;
34
};
35
36
} // namespace Luau
37
38