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

This commit is contained in:
Yuji Hirose 2019-02-27 09:04:58 -05:00
parent 57f866c6ca
commit bbeadfa937

View File

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