77#include < vector>
88
99namespace fe ::ast {
10- struct IdenAstNode {
10+ struct IdentifierAstNode {
1111 std::string value;
12- loc::Loc loc ;
12+ loc::Loc location ;
1313
14- friend std::ostream &operator <<(std::ostream &os , const IdenAstNode &node);
14+ friend std::ostream &operator <<(std::ostream &stream , const IdentifierAstNode &node);
1515 };
1616
1717 struct StringAstNode {
1818 std::string value;
19- loc::Loc loc ;
19+ loc::Loc location ;
2020
21- friend std::ostream &operator <<(std::ostream &os , const StringAstNode &node);
21+ friend std::ostream &operator <<(std::ostream &stream , const StringAstNode &node);
2222 };
2323
2424 struct FloatAstNode {
2525 double value;
26- loc::Loc loc ;
26+ loc::Loc location ;
2727
28- friend std::ostream &operator <<(std::ostream &os , const FloatAstNode &node);
28+ friend std::ostream &operator <<(std::ostream &stream , const FloatAstNode &node);
2929 };
3030
3131 struct Expression ;
3232
3333 struct LambdaExpression {
34- IdenAstNode arg;
35- intp::types::Type arg_type ;
36- std::unique_ptr<Expression> expr ;
37- loc::Loc loc ;
34+ IdentifierAstNode arg;
35+ intp::types::Type argumentType ;
36+ std::unique_ptr<Expression> expression ;
37+ loc::Loc location ;
3838 // / Maybe, this is redundant
3939 // / TODO: Remove after checking
40- intp::types::CompoundType lmd_expr_type; // Lambda Expression Type
40+ intp::types::CompoundType lambdaExpressionType;
4141
42- void print (std::ostream &os , size_t indent) const ;
42+ void print (std::ostream &stream , size_t indent) const ;
4343
44- friend std::ostream &operator <<(std::ostream &os , const LambdaExpression &l_expr );
44+ friend std::ostream &operator <<(std::ostream &stream , const LambdaExpression &lambdaExpression );
4545 };
4646
4747 struct FunctionApplication {
48- IdenAstNode fn_name ;
49- std::vector<std::unique_ptr<Expression> > args ;
50- loc::Loc loc ;
48+ IdentifierAstNode functionName ;
49+ std::vector<std::unique_ptr<Expression> > arguments ;
50+ loc::Loc location ;
5151
52- void print (std::ostream &os , size_t indent) const ;
52+ void print (std::ostream &stream , size_t indent) const ;
5353
54- friend std::ostream &operator <<(std::ostream &os , const FunctionApplication &fn_apl );
54+ friend std::ostream &operator <<(std::ostream &stream , const FunctionApplication &functionApplication );
5555 };
5656
5757 struct Expression {
5858 using ExpressionVariant = std::variant<
59- IdenAstNode ,
59+ IdentifierAstNode ,
6060 StringAstNode,
6161 FloatAstNode,
6262 LambdaExpression,
@@ -65,7 +65,7 @@ namespace fe::ast {
6565
6666 ExpressionVariant value;
6767
68- explicit Expression (IdenAstNode value);
68+ explicit Expression (IdentifierAstNode value);
6969
7070 explicit Expression (StringAstNode value);
7171
@@ -75,11 +75,11 @@ namespace fe::ast {
7575
7676 explicit Expression (FunctionApplication value);
7777
78- void print (std::ostream &os , size_t indent) const ;
78+ void print (std::ostream &stream , size_t indent) const ;
7979
80- friend std::ostream &operator <<(std::ostream &os , const Expression &expr );
80+ friend std::ostream &operator <<(std::ostream &stream , const Expression &expression );
8181
82- [[nodiscard]] loc::Loc get_loc () const ;
82+ [[nodiscard]] loc::Loc getLocation () const ;
8383
8484 Expression (const Expression &) = delete ;
8585
@@ -90,30 +90,30 @@ namespace fe::ast {
9090 Expression &operator =(Expression &&) noexcept = default ;
9191 };
9292
93- struct DefAstNode {
94- IdenAstNode def_name ;
95- intp::types::Type typ ;
96- Expression expr ;
97- loc::Loc loc ;
93+ struct DefinitionAstNode {
94+ IdentifierAstNode definitionName ;
95+ intp::types::Type definitionType ;
96+ Expression expression ;
97+ loc::Loc location ;
9898
99- void print (std::ostream &os , size_t indent) const ;
99+ void print (std::ostream &stream , size_t indent) const ;
100100
101- friend std::ostream &operator <<(std::ostream &os , const DefAstNode &node);
101+ friend std::ostream &operator <<(std::ostream &stream , const DefinitionAstNode &node);
102102 };
103103
104104 struct AstNode {
105- using NodeVariant = std::variant<Expression, DefAstNode >;
105+ using NodeVariant = std::variant<Expression, DefinitionAstNode >;
106106
107107 NodeVariant value;
108108
109- void print (std::ostream &os , size_t indent) const ;
109+ void print (std::ostream &stream , size_t indent) const ;
110110
111- friend std::ostream &operator <<(std::ostream &os , const AstNode &node);
111+ friend std::ostream &operator <<(std::ostream &stream , const AstNode &node);
112112 };
113113
114114 struct Program {
115115 std::vector<AstNode> nodes;
116116
117- friend std::ostream &operator <<(std::ostream &os , const Program &p );
117+ friend std::ostream &operator <<(std::ostream &stream , const Program &program );
118118 };
119119}
0 commit comments