r112004 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112003‎ | r112004 | r112005 >
Date:11:24, 21 February 2012
Author:gwicke
Status:deferred
Tags:
Comment:
Comment and minor code tweaks.
Modified paths:
  • /trunk/extensions/VisualEditor/modules/parser/ext.core.ParserFunctions.js (modified) (history)
  • /trunk/extensions/VisualEditor/modules/parser/mediawiki.TokenTransformManager.js (modified) (history)
  • /trunk/extensions/VisualEditor/modules/parser/mediawiki.parser.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/parser/mediawiki.TokenTransformManager.js
@@ -557,7 +557,9 @@
558558
559559 /**
560560 * Callback from tokens fully processed for phase 0 and 1, which are now ready
561 - * for synchronous and globally in-order phase 2 processing.
 561+ * for synchronous and globally in-order phase 2 processing. Thus each async
 562+ * transform is responsible for fully processing its returned tokens to the
 563+ * end of phase2.
562564 *
563565 * @method
564566 * @param {Array} chunk of tokens
Index: trunk/extensions/VisualEditor/modules/parser/ext.core.ParserFunctions.js
@@ -15,8 +15,6 @@
1616 this.manager = manager;
1717 }
1818
19 -ParserFunctions.prototype.fun = {};
20 -
2119 ParserFunctions.prototype['pf_#if'] = function ( target, argList, argDict ) {
2220 if ( target.trim() !== '' ) {
2321 this.manager.env.dp('#if, first branch', target.trim(), argDict[1] );
@@ -127,8 +125,11 @@
128126
129127 // A first approximation of time stuff.
130128 // TODO: Implement time spec (+ 1 day etc), check if formats are complete etc.
131 -// Based on http://jacwright.com/projects/javascript/date_format/, MIT
132 -// licensed.
 129+// See http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#.23time
 130+// for the full list of requirements!
 131+//
 132+// First (very rough) approximation below based on
 133+// http://jacwright.com/projects/javascript/date_format/, MIT licensed.
133134 ParserFunctions.prototype['pf_#time'] = function ( target, argList, argDict ) {
134135 var res,
135136 tpl = target.trim();
Index: trunk/extensions/VisualEditor/modules/parser/mediawiki.parser.js
@@ -142,13 +142,15 @@
143143 sync01:
144144 [
145145 IncludeOnly,
146 - NoInclude
 146+ NoInclude
147147 ],
148148 // Asynchronous out-of-order per input
149149 async12:
150150 [
 151+ // Insert TokenCollector for extensions here (don't expand
 152+ // templates in extension contents)
151153 TemplateHandler,
152 - AttributeExpander
 154+ AttributeExpander // After templates to avoid expanding unused branches
153155 ],
154156 // Synchronous in-order on fully expanded token stream (including
155157 // expanded templates etc).

Status & tagging log