minor fixes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-02-11 04:22:53 +03:00
parent 7fe24c06fc
commit d694b76220

View File

@ -500,7 +500,7 @@ module.BaseParser = {
return [res] } }) }, return [res] } }) },
function(err){ function(err){
console.error(err) console.error(err)
return page.parse( return [page.parse(
// XXX add line number and page path... // XXX add line number and page path...
'@include("./ParseError' '@include("./ParseError'
+':path=' +':path='
@ -517,9 +517,9 @@ module.BaseParser = {
return '%'+ c.charCodeAt().toString(16) }) return '%'+ c.charCodeAt().toString(16) })
.replace(/:/g, '&colon;') .replace(/:/g, '&colon;')
.replace(/=/g, '&equals;') .replace(/=/g, '&equals;')
+'")') }) +'")')] })
.sync() }, .sync() },
/*/ /*/ // XXX ASYNC
expand: async function*(page, ast, state={}){ expand: async function*(page, ast, state={}){
try{ try{
ast = ast == null ? ast = ast == null ?
@ -631,12 +631,11 @@ module.BaseParser = {
.flat() .flat()
// NOTE: we need to await for ast here as we need stage 2 of // NOTE: we need to await for ast here as we need stage 2 of
// parsing to happen AFTER everything else completes... // parsing to happen AFTER everything else completes...
// XXX
: ast.then(function(ast){ : ast.then(function(ast){
return ast.map(handleItem) return ast.map(handleItem)
.flat() }) .flat() })
.iter() }, .iter() },
/*/ /*/ // XXX ASYNC
resolve: async function*(page, ast, state={}){ resolve: async function*(page, ast, state={}){
ast = ast ast = ast
?? this.expand(page, null, state) ?? this.expand(page, null, state)