From 5521a657c9271e55cbf520892ee3fe11fcbb743a Mon Sep 17 00:00:00 2001 From: chris olin Date: Fri, 13 May 2022 11:08:16 -0400 Subject: [PATCH] sanitize RTS string output --- README.md | 1 + server/public/runtime.js | 2 +- tests/hustle/8.wkt | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 tests/hustle/8.wkt diff --git a/README.md b/README.md index 50a7e1b..dc8d6b3 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,7 @@ Alternatively, your syntax checker may fail to do anything at all, because of th - Tail recursion - Lambdas with arbitrary signatures - update the wat AST in the README to reflect more recent changes +- RTS printing for heap structures ## Complete diff --git a/server/public/runtime.js b/server/public/runtime.js index e4303e8..bb8103b 100644 --- a/server/public/runtime.js +++ b/server/public/runtime.js @@ -66,7 +66,7 @@ function run(){ console.log("unwrapped: ", unwrappedResult); result = unwrappedResult; console.log("result: ", result); - output.innerHTML = output.innerHTML + result; + output.innerHTML = output.innerHTML + result.replace("<", "<").replace(">", ">"); })(); } diff --git a/tests/hustle/8.wkt b/tests/hustle/8.wkt new file mode 100644 index 0000000..281c871 --- /dev/null +++ b/tests/hustle/8.wkt @@ -0,0 +1,2 @@ +#lang wacket +(cdr (cons #\a (cons #\b '()))) \ No newline at end of file