aboutsummaryrefslogtreecommitdiffstats
path: root/src/resp.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resp.hpp')
-rw-r--r--src/resp.hpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/resp.hpp b/src/resp.hpp
index dd5987a..ff1bc19 100644
--- a/src/resp.hpp
+++ b/src/resp.hpp
@@ -418,6 +418,10 @@ struct ATuple : public AST {
}
void constrain(TEnv& tenv, Constraints& c) const throw(Error);
+ const ATuple* prot() const { return list_ref(1)->as<const ATuple*>(); }
+ ATuple* prot() { return list_ref(1)->as<ATuple*>(); }
+ void set_prot(ATuple* prot) { *iter_at(1) = prot; }
+
private:
size_t _len;
AST** _vec;
@@ -449,9 +453,6 @@ struct AType : public ATuple {
AType(Cursor c, AST* ast, va_list args) : ATuple(c, ast, args), kind(EXPR), id(0) {}
AType(AST* first, AST* rest, Cursor c) : ATuple(first, rest, c), kind(EXPR), id(0) {}
AType(const AType& copy) : ATuple(copy), kind(copy.kind), id(copy.id) {}
- const ATuple* prot() const { assert(kind == EXPR); return list_ref(1)->to<const ATuple*>(); }
- ATuple* prot() { assert(kind == EXPR); return list_ref(1)->to<ATuple*>(); }
- void prot(ATuple* prot) { assert(kind == EXPR); *iter_at(1) = prot; }
bool concrete() const {
switch (kind) {
@@ -530,9 +531,6 @@ struct AFn : public ATuple {
AFn(Cursor c, AST* ast, va_list args) : ATuple(c, ast, args) {}
bool operator==(const AST& rhs) const { return this == &rhs; }
void constrain(TEnv& tenv, Constraints& c) const throw(Error);
- const ATuple* prot() const { return list_ref(1)->to<const ATuple*>(); }
- ATuple* prot() { return list_ref(1)->to<ATuple*>(); }
- void prot(ATuple* prot) { *iter_at(1) = prot; }
string name;
};