mirror of
https://github.com/flynx/pWiki.git
synced 2026-08-24 16:26:42 +00:00
Merge branch 'master' of github.com:flynx/pWiki
This commit is contained in:
commit
5061eeb851
@ -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?: <macro src=/moo/> 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...
|
||||
//
|
||||
@ -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))
|
||||
Loading…
x
Reference in New Issue
Block a user