diff --git a/v3/pwiki/parser.js b/v3/pwiki/macros.js similarity index 99% rename from v3/pwiki/parser.js rename to v3/pwiki/macros.js index 2116737..650f34b 100644 --- a/v3/pwiki/parser.js +++ b/v3/pwiki/macros.js @@ -21,7 +21,12 @@ var pwpath = require('./path') // Parser/Runner... // XXX TODO: -// callbacks on elements resolving... +// - callbacks on elements resolving... +// - option/way to wrap macro output -- callback?? +// - naming: +// parser -> macro +// +// // XXX ASAP move the macros here... // XXX BUG?: is not parsed correctly... // XXX need to correctly handle nested and escaped quotes... @@ -30,8 +35,8 @@ var pwpath = require('./path') // XXX RENAME... // ...this handles the syntax and execution... -var BaseParser = -module.BaseParser = { +var BaseMacros = +module.BaseMacros = { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Passive parsing... @@ -966,9 +971,9 @@ function(macro){ // XXX RENAME... // ...this is more of an expander/executer... // ...might be a good idea to also do a check without executing... -var parser = -module.parser = { - __proto__: BaseParser, +var macros = +module.macros = { + __proto__: BaseMacros, // String to be substetuted for a recursive include... // diff --git a/v3/pwiki/test/parser.js b/v3/pwiki/test/macros.js similarity index 99% rename from v3/pwiki/test/parser.js rename to v3/pwiki/test/macros.js index 01cb587..5268711 100755 --- a/v3/pwiki/test/parser.js +++ b/v3/pwiki/test/macros.js @@ -6,12 +6,12 @@ var path = require('path') var test = require('ig-test') var serialize = require('ig-serialize') -var parser = require('../parser').parser +var macros = require('../macros').macros //--------------------------------------------------------------------- -;(parser.filters ??= {}).upper = +;(macros.filters ??= {}).upper = function(str){ return str.toUpperCase() } @@ -56,7 +56,7 @@ module.exports.PAGES = { var P = module.exports.P = { __pages__: PAGES, - __parser__: parser, + __parser__: macros, path: '/', @@ -538,7 +538,7 @@ test.Tests({ var p = serialize.partialDeepCopy(page) var s = serialize.partialDeepCopy(st) assert( - (res = await parser.exec( + (res = await macros.exec( p, input, s))