Always show parse tree in REPL, even if we have a diagnostic.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2021-01-05 12:37:13 +01:00
parent f328762cd8
commit d9d52554e4
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 4 additions and 6 deletions

View File

@ -5,7 +5,7 @@
#include "../src/Parser/Statements/ParsedStatementStringifier.hpp"
#include "InputWindow.hpp"
void ParseAndUpdate(const std::vector<std::u8string> lines, WINDOW* diagnosticsWindow, WINDOW* parsedWindow,
void ParseAndUpdate(const std::vector<std::u8string>& lines, WINDOW* diagnosticsWindow, WINDOW* parsedWindow,
MalachScriptRepl::InputWindow& inputWindow) {
std::u8string script;
for (const auto& line : lines) {
@ -42,12 +42,10 @@ void ParseAndUpdate(const std::vector<std::u8string> lines, WINDOW* diagnosticsW
wrefresh(diagnosticsWindow);
wclear(parsedWindow);
if (logger.GetMessages().empty()) {
std::stringstream ss;
MalachScript::Parser::ParsedStatementStringifier::Stringify(parsedResult, ss, "", true);
std::stringstream ss;
MalachScript::Parser::ParsedStatementStringifier::Stringify(parsedResult, ss, "", true);
waddstr(parsedWindow, ss.str().c_str());
}
waddstr(parsedWindow, ss.str().c_str());
wrefresh(parsedWindow);
inputWindow.SetScriptWithDiagnostics(script, diag);