Fixed problem with PEG Playground when grammar or code text is empty

pull/61/head
Yuji Hirose 6 years ago
parent 57f866c6ca
commit bbeadfa937
  1. 4
      docs/index.js

@ -1,12 +1,12 @@
// Setup editros // Setup editros
const grammar = ace.edit("grammar-editor"); const grammar = ace.edit("grammar-editor");
grammar.setShowPrintMargin(false); grammar.setShowPrintMargin(false);
grammar.setValue(localStorage.getItem('grammarText')); grammar.setValue(localStorage.getItem('grammarText') || '');
grammar.moveCursorTo(0, 0); grammar.moveCursorTo(0, 0);
const code = ace.edit("code-editor"); const code = ace.edit("code-editor");
code.setShowPrintMargin(false); code.setShowPrintMargin(false);
code.setValue(localStorage.getItem('codeText')); code.setValue(localStorage.getItem('codeText') || '');
code.moveCursorTo(0, 0); code.moveCursorTo(0, 0);
const codeAst = ace.edit("code-ast"); const codeAst = ace.edit("code-ast");

Loading…
Cancel
Save