2023-03-17 22:59:30 +08:00
|
|
|
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
namespace Luau
|
|
|
|
{
|
|
|
|
|
|
|
|
struct Scope;
|
|
|
|
using ScopePtr = std::shared_ptr<Scope>;
|
|
|
|
|
|
|
|
enum class ControlFlow
|
|
|
|
{
|
2023-03-25 01:34:14 +08:00
|
|
|
None = 0b00001,
|
|
|
|
Returns = 0b00010,
|
|
|
|
Throws = 0b00100,
|
2023-09-30 08:22:06 +08:00
|
|
|
Breaks = 0b01000,
|
|
|
|
Continues = 0b10000,
|
2023-03-17 22:59:30 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
inline ControlFlow operator&(ControlFlow a, ControlFlow b)
|
|
|
|
{
|
|
|
|
return ControlFlow(int(a) & int(b));
|
|
|
|
}
|
|
|
|
|
|
|
|
inline ControlFlow operator|(ControlFlow a, ControlFlow b)
|
|
|
|
{
|
|
|
|
return ControlFlow(int(a) | int(b));
|
|
|
|
}
|
|
|
|
|
|
|
|
inline bool matches(ControlFlow a, ControlFlow b)
|
|
|
|
{
|
|
|
|
return (a & b) != ControlFlow(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Luau
|