From c62f77a5d2874570f92ca6936df7d64eee7f4ae1 Mon Sep 17 00:00:00 2001 From: Christopher Pfohl Date: Wed, 7 Feb 2018 05:46:32 -0500 Subject: [PATCH 1/2] Empty Each Blocks should have consistent behavior. Here the `error-each-blocks-empty` behaves as expected. It throws a ParseError. I can't get the whitespace errors to repro in the tests. They're easily seen here: https://svelte.technology/repl?version=1.51.0&gist=e1596f9631619a689e85c80e46506692 If you uncomment each section in sequence it demonstrates the behavior. I can't quite figure out why my examples don't work. --- test/parser/samples/error-comment-unclosed/error.json | 8 ++++++++ test/parser/samples/error-comment-unclosed/input.html | 1 + test/parser/samples/error-each-blocks-empty/error.json | 8 ++++++++ test/parser/samples/error-each-blocks-empty/input.html | 1 + .../samples/error-each-blocks-keyed-whitespace/error.json | 8 ++++++++ .../samples/error-each-blocks-keyed-whitespace/input.html | 8 ++++++++ .../samples/error-each-blocks-whitespace/error.json | 8 ++++++++ .../samples/error-each-blocks-whitespace/input.html | 2 ++ 8 files changed, 44 insertions(+) create mode 100644 test/parser/samples/error-comment-unclosed/error.json create mode 100644 test/parser/samples/error-comment-unclosed/input.html create mode 100644 test/parser/samples/error-each-blocks-empty/error.json create mode 100644 test/parser/samples/error-each-blocks-empty/input.html create mode 100644 test/parser/samples/error-each-blocks-keyed-whitespace/error.json create mode 100644 test/parser/samples/error-each-blocks-keyed-whitespace/input.html create mode 100644 test/parser/samples/error-each-blocks-whitespace/error.json create mode 100644 test/parser/samples/error-each-blocks-whitespace/input.html diff --git a/test/parser/samples/error-comment-unclosed/error.json b/test/parser/samples/error-comment-unclosed/error.json new file mode 100644 index 0000000000..2502a32735 --- /dev/null +++ b/test/parser/samples/error-comment-unclosed/error.json @@ -0,0 +1,8 @@ +{ + "message": "comment was left open", + "loc": { + "line": 1, + "column": 0 + }, + "pos": 0 +} diff --git a/test/parser/samples/error-comment-unclosed/input.html b/test/parser/samples/error-comment-unclosed/input.html new file mode 100644 index 0000000000..725cf9be60 --- /dev/null +++ b/test/parser/samples/error-comment-unclosed/input.html @@ -0,0 +1 @@ +