From b64d16088b29615d222d33450cf0315467400e59 Mon Sep 17 00:00:00 2001 From: Patrick Schönberger Date: Thu, 29 Jul 2021 09:58:14 +0200 Subject: toc now uses internal representation instead of ast --- src/repr.h | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'src/repr.h') 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 parameters; Body body; @@ -65,7 +66,7 @@ enum class ExprType { }; struct CallExpr { - Function function; + std::string functionName; std::vector arguments; }; @@ -78,11 +79,8 @@ struct VariableExpr { }; struct BracketsExpr { - BracketsExpr() {} - BracketsExpr(const BracketsExpr &) {} - BracketsExpr & operator=(const BracketsExpr &) {return *this;}; - std::unique_ptr lexpr; - std::unique_ptr rexpr; + std::shared_ptr lexpr; + std::shared_ptr 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 lexpr; - std::unique_ptr rexpr; + std::shared_ptr lexpr; + std::shared_ptr rexpr; OperatorType type; }; struct DotExpr { - DotExpr() {} - DotExpr(const DotExpr &) {} - DotExpr & operator=(const DotExpr &) {return *this;}; - std::unique_ptr lexpr; + std::shared_ptr lexpr; std::string name; }; -- cgit v1.2.3