aboutsummaryrefslogtreecommitdiff
path: root/docs/repl.js
diff options
context:
space:
mode:
Diffstat (limited to 'docs/repl.js')
-rw-r--r--docs/repl.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/docs/repl.js b/docs/repl.js
index b6e54d6b..8ba74496 100644
--- a/docs/repl.js
+++ b/docs/repl.js
@@ -57,9 +57,16 @@ if (doc.doexplain) doc.doexplain.onclick = () => {
,[[0,1,0],[0,0,1],[0,0,[[],[2]]],[0,0,3],[0,0,4],[0,0,5],[0,0,6],[0,0,[[],[7]]],[0,0,8],[0,0,[[],[9]]],[1,1,10],[0,0,11],[0,0,[[],[12]]],[0,0,13],[1,0,[[],[14]]],[0,0,15],[0,0,[[],[16]]],[0,0,17],[1,1,18],[0,1,19],[0,0,[[],[20]]],[0,0,21],[0,0,[[],[22]]]]
,[[0,31],[516,4],[603,8],[723,3],[736,10],[982,3],[992,3],[1002,3],[1018,4],[1069,3],[1094,2],[1124,3],[1138,34],[2058,3],[2101,5],[2113,3],[2152,4],[2242,4],[2338,2],[2368,2],[2470,22],[3000,5],[3082,3]]
);
+ let draw = (s,c) => {
+ try {
+ return drawEval(s,c).map(l=>l.join("")).join("\n");
+ } catch(e) {
+ return "Explain failed (it's a bug!)";
+ }
+ }
explain = (s,c) => {
let e = doc.explain;
- e.innerHTML = s?drawEval(s,c).map(l=>l.join("")).join("\n"):'';
+ e.innerHTML = s ? draw(s,c) : '';
setTimeout(() => {
e.querySelectorAll('tspan').forEach(t => {
let c = t.textContent, h = primhelp[c];