diff --git a/dingus/dingus.js b/dingus/dingus.js index ca70cc3..d43f1bd 100644 --- a/dingus/dingus.js +++ b/dingus/dingus.js @@ -72,8 +72,6 @@ let grammar_editor = null; let input_editor = null; function render_parse_results(message) { - console.log("WHAT?"); - function render_tree_node(parent, node) { const tree_div = document.createElement("div"); tree_div.classList.add("parsed-node"); @@ -89,8 +87,12 @@ function render_parse_results(message) { {scroll: true}, ); }; + if (node.start == node.end) { + node_label.classList.add("parsed-error-node"); + } tree_div.appendChild(node_label); + if (node.kind === "tree") { tree_div.classList.add("parsed-tree"); for (const child of node.children) { diff --git a/dingus/style.css b/dingus/style.css index 0b9426f..4ae038f 100644 --- a/dingus/style.css +++ b/dingus/style.css @@ -57,6 +57,10 @@ body { margin-left: 1rem; } +.parsed-error-node { + color: red; +} + .main-textarea { height: 100%; width: 100%;