mirror of
https://github.com/luau-lang/luau.git
synced 2024-12-13 13:30:40 +00:00
944e8375aa
- Type aliases can no longer override primitive types; attempts to do that will result in a type error - Fix misleading type error messages for mismatches in expression list length during assignment - Fix incorrect type name display in certain cases - setmetatable/getmetatable are now ~2x faster - tools/perfstat.py can be used to display statistics about profiles captured via --profile switch
55 lines
1.3 KiB
C++
55 lines
1.3 KiB
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/Linter.h"
|
|
#include "Luau/ParseOptions.h"
|
|
|
|
#include <string>
|
|
#include <optional>
|
|
#include <vector>
|
|
|
|
namespace Luau
|
|
{
|
|
|
|
using ModuleName = std::string;
|
|
|
|
constexpr const char* kConfigName = ".luaurc";
|
|
|
|
struct Config
|
|
{
|
|
Config();
|
|
|
|
Mode mode;
|
|
|
|
ParseOptions parseOptions;
|
|
|
|
LintOptions enabledLint;
|
|
LintOptions fatalLint;
|
|
|
|
bool lintErrors = false;
|
|
bool typeErrors = true;
|
|
|
|
std::vector<std::string> globals;
|
|
};
|
|
|
|
struct ConfigResolver
|
|
{
|
|
virtual ~ConfigResolver() {}
|
|
|
|
virtual const Config& getConfig(const ModuleName& name) const = 0;
|
|
};
|
|
|
|
struct NullConfigResolver : ConfigResolver
|
|
{
|
|
Config defaultConfig;
|
|
|
|
virtual const Config& getConfig(const ModuleName& name) const override;
|
|
};
|
|
|
|
std::optional<std::string> parseModeString(Mode& mode, const std::string& modeString, bool compat = false);
|
|
std::optional<std::string> parseLintRuleString(
|
|
LintOptions& enabledLints, LintOptions& fatalLints, const std::string& warningName, const std::string& value, bool compat = false);
|
|
|
|
std::optional<std::string> parseConfig(const std::string& contents, Config& config, bool compat = false);
|
|
|
|
} // namespace Luau
|