mirror of
https://github.com/luau-lang/luau.git
synced 2024-11-15 14:25:44 +08:00
37 lines
738 B
C
37 lines
738 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 <memory>
|
||
|
|
||
|
namespace Luau
|
||
|
{
|
||
|
|
||
|
struct Scope;
|
||
|
using ScopePtr = std::shared_ptr<Scope>;
|
||
|
|
||
|
enum class ControlFlow
|
||
|
{
|
||
|
None = 0b00001,
|
||
|
Returns = 0b00010,
|
||
|
Throws = 0b00100,
|
||
|
Break = 0b01000, // Currently unused.
|
||
|
Continue = 0b10000, // Currently unused.
|
||
|
};
|
||
|
|
||
|
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
|