https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112004

Revision: 112004
Author:   gwicke
Date:     2012-02-21 11:24:20 +0000 (Tue, 21 Feb 2012)
Log Message:
-----------
Comment and minor code tweaks.

Modified Paths:
--------------
    trunk/extensions/VisualEditor/modules/parser/ext.core.ParserFunctions.js
    
trunk/extensions/VisualEditor/modules/parser/mediawiki.TokenTransformManager.js
    trunk/extensions/VisualEditor/modules/parser/mediawiki.parser.js

Modified: 
trunk/extensions/VisualEditor/modules/parser/ext.core.ParserFunctions.js
===================================================================
--- trunk/extensions/VisualEditor/modules/parser/ext.core.ParserFunctions.js    
2012-02-21 11:21:17 UTC (rev 112003)
+++ trunk/extensions/VisualEditor/modules/parser/ext.core.ParserFunctions.js    
2012-02-21 11:24:20 UTC (rev 112004)
@@ -15,8 +15,6 @@
        this.manager = manager;
 }
 
-ParserFunctions.prototype.fun = {};
-
 ParserFunctions.prototype['pf_#if'] = function ( target, argList, argDict ) {
        if ( target.trim() !== '' ) {
                this.manager.env.dp('#if, first branch', target.trim(), 
argDict[1] );
@@ -127,8 +125,11 @@
 
 // A first approximation of time stuff.
 // TODO: Implement time spec (+ 1 day etc), check if formats are complete etc.
-// Based on http://jacwright.com/projects/javascript/date_format/, MIT
-// licensed.
+// See http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#.23time
+// for the full list of requirements!
+//
+// First (very rough) approximation below based on
+// http://jacwright.com/projects/javascript/date_format/, MIT licensed.
 ParserFunctions.prototype['pf_#time'] = function ( target, argList, argDict ) {
        var res,
                tpl = target.trim();

Modified: 
trunk/extensions/VisualEditor/modules/parser/mediawiki.TokenTransformManager.js
===================================================================
--- 
trunk/extensions/VisualEditor/modules/parser/mediawiki.TokenTransformManager.js 
    2012-02-21 11:21:17 UTC (rev 112003)
+++ 
trunk/extensions/VisualEditor/modules/parser/mediawiki.TokenTransformManager.js 
    2012-02-21 11:24:20 UTC (rev 112004)
@@ -557,7 +557,9 @@
 
 /**
  * Callback from tokens fully processed for phase 0 and 1, which are now ready
- * for synchronous and globally in-order phase 2 processing.
+ * for synchronous and globally in-order phase 2 processing. Thus each async
+ * transform is responsible for fully processing its returned tokens to the
+ * end of phase2.
  *
  * @method
  * @param {Array} chunk of tokens

Modified: trunk/extensions/VisualEditor/modules/parser/mediawiki.parser.js
===================================================================
--- trunk/extensions/VisualEditor/modules/parser/mediawiki.parser.js    
2012-02-21 11:21:17 UTC (rev 112003)
+++ trunk/extensions/VisualEditor/modules/parser/mediawiki.parser.js    
2012-02-21 11:24:20 UTC (rev 112004)
@@ -142,13 +142,15 @@
                sync01: 
                        [ 
                                IncludeOnly, 
-                               NoInclude 
+                               NoInclude
                        ],
                // Asynchronous out-of-order per input
                async12: 
                        [ 
+                               // Insert TokenCollector for extensions here 
(don't expand
+                               // templates in extension contents)
                                TemplateHandler,
-                               AttributeExpander 
+                               AttributeExpander // After templates to avoid 
expanding unused branches
                        ],
                // Synchronous in-order on fully expanded token stream 
(including
                // expanded templates etc).


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to