@@ -9,41 +9,41 @@ namespace frontend {
99 }
1010 }
1111
12- std::ostream &operator <<(std::ostream &stream , const IdentifierAstNode &node) {
13- return stream << node.value ;
12+ std::ostream &operator <<(std::ostream &outputStream , const IdentifierAstNode &node) {
13+ return outputStream << node.value ;
1414 }
1515
16- std::ostream &operator <<(std::ostream &stream , const StringAstNode &node) {\
17- return stream << " \" " << escapeString (node.value ) << " \" " ;
16+ std::ostream &operator <<(std::ostream &outputStream , const StringAstNode &node) {\
17+ return outputStream << " \" " << escapeString (node.value ) << " \" " ;
1818 }
1919
20- std::ostream &operator <<(std::ostream &stream , const FloatAstNode &node) {
21- return stream << node.value ;
20+ std::ostream &operator <<(std::ostream &outputStream , const FloatAstNode &node) {
21+ return outputStream << node.value ;
2222 }
2323
24- void LambdaExpression::print (std::ostream &stream , const size_t indent) const {
25- printIndent (stream , indent);
26- stream << " \\ " << argument << " : " << argumentType << " ." << std::endl;
27- expression->print (stream , indent + 1 );
24+ void LambdaExpression::print (std::ostream &outputStream , const size_t indent) const {
25+ printIndent (outputStream , indent);
26+ outputStream << " \\ " << argument << " : " << argumentType << " ." << std::endl;
27+ expression->print (outputStream , indent + 1 );
2828 }
2929
30- std::ostream &operator <<(std::ostream &stream , const LambdaExpression &lambdaExpression) {
31- lambdaExpression.print (stream , 0 );
32- return stream ;
30+ std::ostream &operator <<(std::ostream &outputStream , const LambdaExpression &lambdaExpression) {
31+ lambdaExpression.print (outputStream , 0 );
32+ return outputStream ;
3333 }
3434
35- void FunctionApplication::print (std::ostream &stream , const size_t indent) const {
36- printIndent (stream , indent);
37- stream << " (" << functionName;
35+ void FunctionApplication::print (std::ostream &outputStream , const size_t indent) const {
36+ printIndent (outputStream , indent);
37+ outputStream << " (" << functionName;
3838 for (auto &argument: arguments) {
39- stream << " " << *argument;
39+ outputStream << " " << *argument;
4040 }
41- stream << " )" ;
41+ outputStream << " )" ;
4242 }
4343
44- std::ostream &operator <<(std::ostream &stream , const FunctionApplication &functionApplication) {
45- functionApplication.print (stream , 0 );
46- return stream ;
44+ std::ostream &operator <<(std::ostream &outputStream , const FunctionApplication &functionApplication) {
45+ functionApplication.print (outputStream , 0 );
46+ return outputStream ;
4747 }
4848
4949 Expression::Expression (IdentifierAstNode value) : value(std::move(value)) {
@@ -61,25 +61,25 @@ namespace frontend {
6161 Expression::Expression (FunctionApplication value) : value(std::move(value)) {
6262 }
6363
64- void Expression::print (std::ostream &stream , size_t indent) const {
64+ void Expression::print (std::ostream &outputStream , size_t indent) const {
6565 std::visit ([&]<typename T0 >(T0 &&argument) {
6666 using T = std::decay_t <T0 >;
6767 if constexpr (std::is_same_v<T, IdentifierAstNode>
6868 || std::is_same_v<T, StringAstNode>
6969 || std::is_same_v<T, FloatAstNode>) {
70- printIndent (stream , indent);
71- stream << argument;
70+ printIndent (outputStream , indent);
71+ outputStream << argument;
7272 } else if constexpr (std::is_same_v<T, LambdaExpression> || std::is_same_v<T, FunctionApplication>) {
73- argument.print (stream , indent);
73+ argument.print (outputStream , indent);
7474 } else {
7575 STATIC_ASSERT_UNREACHABLE_T (T, " unhandled expression" );
7676 }
7777 }, value);
7878 }
7979
80- std::ostream &operator <<(std::ostream &stream , const Expression &expression) {
81- expression.print (stream , 0 );
82- return stream ;
80+ std::ostream &operator <<(std::ostream &outputStream , const Expression &expression) {
81+ expression.print (outputStream , 0 );
82+ return outputStream ;
8383 }
8484
8585 Location Expression::getLocation () const {
@@ -88,32 +88,32 @@ namespace frontend {
8888 }, value);
8989 }
9090
91- void DefinitionAstNode::print (std::ostream &stream , const size_t indent) const {
92- printIndent (stream , indent);
93- stream << " def " << definitionName << " : " << definitionType << " = " << expression;
91+ void DefinitionAstNode::print (std::ostream &outputStream , const size_t indent) const {
92+ printIndent (outputStream , indent);
93+ outputStream << " def " << definitionName << " : " << definitionType << " = " << expression;
9494 }
9595
96- std::ostream &operator <<(std::ostream &stream , const DefinitionAstNode &node) {
97- node.print (stream , 0 );
98- return stream ;
96+ std::ostream &operator <<(std::ostream &outputStream , const DefinitionAstNode &node) {
97+ node.print (outputStream , 0 );
98+ return outputStream ;
9999 }
100100
101- void AstNode::print (std::ostream &stream , size_t indent) const {
101+ void AstNode::print (std::ostream &outputStream , size_t indent) const {
102102 std::visit ([&](auto &&arg) {
103- arg.print (stream , indent);
103+ arg.print (outputStream , indent);
104104 }, value);
105- stream << std::endl;
105+ outputStream << std::endl;
106106 }
107107
108- std::ostream &operator <<(std::ostream &stream , const AstNode &node) {
109- node.print (stream , 0 );
110- return stream ;
108+ std::ostream &operator <<(std::ostream &outputStream , const AstNode &node) {
109+ node.print (outputStream , 0 );
110+ return outputStream ;
111111 }
112112
113- std::ostream &operator <<(std::ostream &stream , const Program &program) {
113+ std::ostream &operator <<(std::ostream &outputStream , const Program &program) {
114114 for (const AstNode &node: program.nodes ) {
115- stream << node;
115+ outputStream << node;
116116 }
117- return stream ;
117+ return outputStream ;
118118 }
119119}
0 commit comments