@@ -38,13 +38,15 @@ Mlang::Result Mlang::execute(const std::string& theFile,
3838 const std::string& theCode) {
3939 Tokenizer tokenizer (theFile, theCode);
4040
41+ std::cout << " Tokens:" << std::endl;
4142 auto tokens = tokenizer.getTokens ();
4243 if (settings.showTokens ) {
4344 for (auto token : tokens) {
4445 std::cout << token << " " ;
4546 }
4647 std::cout << std::endl;
4748 }
49+ std::cout << std::endl;
4850
4951 Parser parser (std::move (tokens));
5052 auto ast = parser.getAst ();
@@ -55,8 +57,9 @@ Mlang::Result Mlang::execute(const std::string& theFile,
5557 .addError (parser.getError (theCode));
5658 }
5759
58- if (settings.showAbastractSyntaxTree ) {
59- std::cout << ast->toString () << std::endl;
60+ if (settings.showAbstractSyntaxTree ) {
61+ std::cout << " Abstract Syntax Tree:" << std::endl;
62+ std::cout << ast->toString () << std::endl << std::endl;
6063 }
6164
6265 {
@@ -90,7 +93,7 @@ Mlang::Result Mlang::execute(const std::string& theFile,
9093
9194 if (settings.showTypeInference ) {
9295 std::cout << " After InfereIdentifierTypes: " << std::endl;
93- std::cout << ast->toString () << std::endl;
96+ std::cout << ast->toString () << std::endl << std::endl ;
9497 }
9598
9699 // Function types / params
@@ -99,7 +102,7 @@ Mlang::Result Mlang::execute(const std::string& theFile,
99102
100103 if (settings.showTypeInference ) {
101104 std::cout << " After InfereParameterTypes: " << std::endl;
102- std::cout << ast->toString () << std::endl;
105+ std::cout << ast->toString () << std::endl << std::endl ;
103106 }
104107
105108 validator.process (ast);
@@ -111,6 +114,9 @@ Mlang::Result Mlang::execute(const std::string& theFile,
111114 break ;
112115 } else {
113116 lastUnresolved = validator.getNumUnresolved ();
117+ if (settings.showTypeInference ) {
118+ std::cout << " After round of type inference we have " << lastUnresolved << " unresolved types" << std::endl << std::endl;
119+ }
114120 validator.reset ();
115121 }
116122 }
@@ -136,7 +142,7 @@ Mlang::Result Mlang::execute(const std::string& theFile,
136142 }
137143
138144 if (settings.showInferedTypes ) {
139- std::cout << ast->toString () << std::endl;
145+ std::cout << ast->toString () << std::endl << std::endl ;
140146 }
141147 }
142148
0 commit comments