!7 sclass BottomUpParser > DynSCPWithInput { transient S lastOutput; start { set flag DynModule. // for transpilation dm_useLocallyCopiedMechLists(); set flag NoFancyMechParsing. ai_parser_activateStandardFunctions(); doEvery(5000, r { if (dm_isShowingAndOSInForeground()) update(inputChooser.input()) }); } void update(S s) { temp enter(); if (!isShowing()) { inputChooser.forgetInput(); ret; } PTElement root = ai_parseToTreeWithGuessing(s); S rendered = ai_renderParseTree(root); bool shouldVis = neq(rendered, lastOutput); lastOutput = rendered; if (shouldVis) setComponent(jDynamicTree(root, func(final PTElement e) -> L { e == null ? null : e.children })); } }