-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Reduce the stack utilization of type checking. * Improve the error message that's reported when a delimiting comma is missing from a table literal. eg ```lua local t = { first = 1 second = 2 }```
- Loading branch information
1 parent
e43a9e9
commit c33700e
Showing
78 changed files
with
3,124 additions
and
3,049 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details | ||
#pragma once | ||
|
||
#include "Luau/Def.h" | ||
#include "Luau/TypedAllocator.h" | ||
#include "Luau/TypeVar.h" | ||
#include "Luau/Variant.h" | ||
|
||
#include <memory> | ||
|
||
namespace Luau | ||
{ | ||
|
||
struct Negation; | ||
struct Conjunction; | ||
struct Disjunction; | ||
struct Equivalence; | ||
struct Proposition; | ||
using Connective = Variant<Negation, Conjunction, Disjunction, Equivalence, Proposition>; | ||
using ConnectiveId = Connective*; // Can and most likely is nullptr. | ||
|
||
struct Negation | ||
{ | ||
ConnectiveId connective; | ||
}; | ||
|
||
struct Conjunction | ||
{ | ||
ConnectiveId lhs; | ||
ConnectiveId rhs; | ||
}; | ||
|
||
struct Disjunction | ||
{ | ||
ConnectiveId lhs; | ||
ConnectiveId rhs; | ||
}; | ||
|
||
struct Equivalence | ||
{ | ||
ConnectiveId lhs; | ||
ConnectiveId rhs; | ||
}; | ||
|
||
struct Proposition | ||
{ | ||
DefId def; | ||
TypeId discriminantTy; | ||
}; | ||
|
||
template<typename T> | ||
const T* get(ConnectiveId connective) | ||
{ | ||
return get_if<T>(connective); | ||
} | ||
|
||
struct ConnectiveArena | ||
{ | ||
TypedAllocator<Connective> allocator; | ||
|
||
ConnectiveId negation(ConnectiveId connective); | ||
ConnectiveId conjunction(ConnectiveId lhs, ConnectiveId rhs); | ||
ConnectiveId disjunction(ConnectiveId lhs, ConnectiveId rhs); | ||
ConnectiveId equivalence(ConnectiveId lhs, ConnectiveId rhs); | ||
ConnectiveId proposition(DefId def, TypeId discriminantTy); | ||
}; | ||
|
||
} // namespace Luau |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.