1
0
mirror of https://github.com/aNNiMON/HotaruFX.git synced 2024-09-19 14:14:21 +03:00

Fix parse errors log

This commit is contained in:
Victor 2017-09-05 15:17:50 +03:00
parent aa19abbd38
commit 00b7698c1f
2 changed files with 2 additions and 7 deletions

View File

@ -22,6 +22,6 @@ public class ParseError {
@Override @Override
public String toString() { public String toString() {
return "ParseError " + exception.getMessage() + " at " + pos.toString(); return "ParseError " + exception.getMessage();
} }
} }

View File

@ -7,7 +7,6 @@ import com.annimon.hotarufx.bundles.NodesBundle;
import com.annimon.hotarufx.lexer.HotaruLexer; import com.annimon.hotarufx.lexer.HotaruLexer;
import com.annimon.hotarufx.lib.Context; import com.annimon.hotarufx.lib.Context;
import com.annimon.hotarufx.parser.HotaruParser; import com.annimon.hotarufx.parser.HotaruParser;
import com.annimon.hotarufx.parser.ParseError;
import com.annimon.hotarufx.parser.visitors.InterpreterVisitor; import com.annimon.hotarufx.parser.visitors.InterpreterVisitor;
import com.annimon.hotarufx.ui.SyntaxHighlighter; import com.annimon.hotarufx.ui.SyntaxHighlighter;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
@ -64,11 +63,7 @@ public class EditorController implements Initializable {
val parser = new HotaruParser(HotaruLexer.tokenize(input)); val parser = new HotaruParser(HotaruLexer.tokenize(input));
val program = parser.parse(); val program = parser.parse();
if (parser.getParseErrors().hasErrors()) { if (parser.getParseErrors().hasErrors()) {
val sb = new StringBuilder(); log.setText(parser.getParseErrors().toString());
for (ParseError parseError : parser.getParseErrors()) {
sb.append(parseError);
}
log.setText(sb.toString());
logPane.setExpanded(true); logPane.setExpanded(true);
return; return;
} }