mirror of
https://codeberg.org/ProgramSnail/lang.git
synced 2025-12-15 11:28:46 +00:00
part of type checker, type heck result type
This commit is contained in:
parent
48c9e200be
commit
17ff590048
13 changed files with 1022 additions and 321 deletions
|
|
@ -529,11 +529,12 @@ private:
|
|||
ExpressionProxy expression_;
|
||||
};
|
||||
|
||||
class Expression {
|
||||
class Expression : public Node {
|
||||
public:
|
||||
template <typename T>
|
||||
Expression(T &&expression, bool is_scoped)
|
||||
: expression_(std::forward<T>(expression)), is_scoped_(is_scoped) {}
|
||||
Expression(Node node, T &&expression, bool is_scoped)
|
||||
: Node(node), expression_(std::forward<T>(expression)),
|
||||
is_scoped_(is_scoped) {}
|
||||
|
||||
template <typename T> std::optional<T *> get() {
|
||||
if (std::holds_alternative<T>(expression_)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue