From 8dc6a287f876b5f0377f9c71b06dc8e133dccca0 Mon Sep 17 00:00:00 2001 From: yhirose Date: Wed, 13 Jan 2021 10:11:06 -0500 Subject: [PATCH] Added error recovery feature --- docs/index.js | 11 +- docs/native.js | 2 +- docs/native.wasm | Bin 351091 -> 353675 bytes lint/peglint.cc | 35 ++- peglib.h | 632 +++++++++++++++++++++++++++++------------------ test/test1.cc | 2 - test/test2.cc | 144 ++++++++++- test/test3.cc | 2 - 8 files changed, 565 insertions(+), 263 deletions(-) diff --git a/docs/index.js b/docs/index.js index 646b9f8..af3c94e 100644 --- a/docs/index.js +++ b/docs/index.js @@ -30,11 +30,20 @@ codeAstOptimized.renderer.$cursorLayer.element.style.opacity=0; $('#opt_mode').val(localStorage.getItem('optimazationMode') || 'all'); $('#opt_rules').val(localStorage.getItem('optimazationRules')); +function escapeHtml(unsafe) { + return unsafe + .replace(/&/g, "&") + .replace(//g, ">") + .replace(/"/g, """) + .replace(/'/g, "'"); +} + function generateErrorListHTML(errors) { let html = '