abouttreesummaryrefslogcommitdiff
path: root/src/repr.h
diff options
context:
space:
mode:
authorPatrick Schönberger2021-07-29 09:58:14 +0200
committerPatrick Schönberger2021-07-29 09:58:14 +0200
commitb64d16088b29615d222d33450cf0315467400e59 (patch)
tree7fe3a5bdbe33fe286ad25282ce955bd906097755 /src/repr.h
parent45409c781a9e35df68c43b1e2f028d30bf90c0a0 (diff)
downloadtoc-b64d16088b29615d222d33450cf0315467400e59.tar.gz
toc-b64d16088b29615d222d33450cf0315467400e59.zip
toc now uses internal representation instead of ast
Diffstat (limited to 'src/repr.h')
-rw-r--r--src/repr.h22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/repr.h b/src/repr.h
index ce176ef..6737ef4 100644
--- a/src/repr.h
+++ b/src/repr.h
@@ -43,6 +43,7 @@ struct Body {
};
struct Function {
+ Type returnType;
std::string name;
std::vector<Variable> parameters;
Body body;
@@ -65,7 +66,7 @@ enum class ExprType {
};
struct CallExpr {
- Function function;
+ std::string functionName;
std::vector<Expr> arguments;
};
@@ -78,11 +79,8 @@ struct VariableExpr {
};
struct BracketsExpr {
- BracketsExpr() {}
- BracketsExpr(const BracketsExpr &) {}
- BracketsExpr & operator=(const BracketsExpr &) {return *this;};
- std::unique_ptr<Expr> lexpr;
- std::unique_ptr<Expr> rexpr;
+ std::shared_ptr<Expr> lexpr;
+ std::shared_ptr<Expr> rexpr;
};
enum class OperatorType {
@@ -92,19 +90,13 @@ enum class OperatorType {
};
struct OperatorExpr {
- OperatorExpr() {}
- OperatorExpr(const OperatorExpr &) {}
- OperatorExpr & operator=(const OperatorExpr &) {return *this;};
- std::unique_ptr<Expr> lexpr;
- std::unique_ptr<Expr> rexpr;
+ std::shared_ptr<Expr> lexpr;
+ std::shared_ptr<Expr> rexpr;
OperatorType type;
};
struct DotExpr {
- DotExpr() {}
- DotExpr(const DotExpr &) {}
- DotExpr & operator=(const DotExpr &) {return *this;};
- std::unique_ptr<Expr> lexpr;
+ std::shared_ptr<Expr> lexpr;
std::string name;
};