Skip to content

Commit

Permalink
fixing bugs with foi-toy (web and cli), including updating to include…
Browse files Browse the repository at this point in the history
… changes to the external ebnf validator
  • Loading branch information
getify committed Nov 15, 2023
1 parent d83de56 commit 4badfe4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
24 changes: 12 additions & 12 deletions foi-toy/src/external/ebnftest.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion foi-toy/src/grammar-checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ elems.grammar.value = "S := '';";
function initChecker(context) {
elems.output.addEventListener("_className",evt => {
if (elems.grammar.value != "" && elems.input.value != "") {
context.postMessage({ [evt.target.className]: evt.target.innerHTML, });
context.postMessage({ [evt.target.className]: evt.target.innerText, });
}
});

Expand All @@ -47,6 +47,7 @@ function onMessage(message) {
function elem(_id) {
var _value = "";
var _html = "";
var _text = "";
var _className = "valid";
var cbs = {};
var publicAPI = {
Expand Down Expand Up @@ -83,6 +84,14 @@ function elem(_id) {
publicAPI.dispatchEvent({ type: "_innerHTML", target: publicAPI });
return v;
},
get innerText() {
return _text;
},
set innerText(v) {
_text = v;
publicAPI.dispatchEvent({ type: "_innerText", target: publicAPI });
return v;
},
get className() {
return _className;
},
Expand Down

0 comments on commit 4badfe4

Please sign in to comment.