From 7f42cc98b3f4bd1da049d6f0532c89bfac89e3f7 Mon Sep 17 00:00:00 2001 From: Rich-Harris Date: Thu, 17 Nov 2016 00:20:38 -0500 Subject: [PATCH] more parsing --- README.md | 3 + compiler/generate/index.js | 132 +++++++++++++++- compiler/generate/walkHtml.js | 15 ++ compiler/parse/__test__.js | 118 +++++++++++--- compiler/parse/index.js | 289 ++++++++++++++++++++++++++-------- package.json | 4 +- test/test.js | 5 +- 7 files changed, 475 insertions(+), 91 deletions(-) create mode 100644 README.md create mode 100644 compiler/generate/walkHtml.js diff --git a/README.md b/README.md new file mode 100644 index 0000000000..7073f67db7 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# svelte + +Coming soon... diff --git a/compiler/generate/index.js b/compiler/generate/index.js index 50d83e9b42..f8fde71546 100644 --- a/compiler/generate/index.js +++ b/compiler/generate/index.js @@ -1,7 +1,133 @@ +import deindent from 'deindent'; +import walkHtml from './walkHtml.js'; + export default function generate ( parsed ) { - return ` + const counters = { + element: 0, + text: 0, + anchor: 0 + }; + + const renderBlocks = []; + const updateBlocks = []; + const teardownBlocks = []; + + const codeBlocks = []; + + // TODO add contents of