From 8baa8da94bdd1bc2e4fbac22ee5e2267079fdee1 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sat, 16 Apr 2022 22:35:51 +0300 Subject: [PATCH] working on macro expansion... Signed-off-by: Alex A. Naanou --- pwiki2.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pwiki2.js b/pwiki2.js index 3178d8e..c52f6dc 100755 --- a/pwiki2.js +++ b/pwiki2.js @@ -508,6 +508,22 @@ function*(str){ yield* group(lex(str)) } +var expand = +module.expand = +function(str){ + var parser = parse(str) + while(true){ + var {elem, done} = parse.next() + if(done){ + return } + // text block... + if(typeof(elem) == 'string'){ + yield elem } + + } +} + + // XXX var expandPage = module.expandPage =