r111550 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111549‎ | r111550 | r111551 >
Date:15:56, 15 February 2012
Author:gwicke
Status:deferred
Tags:
Comment:
Tweaked template parameters a bit further, and made the self-closing tag
protection a bit less trigger-happy.
Modified paths:
  • /trunk/extensions/VisualEditor/modules/parser/pegTokenizer.pegjs.txt (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/parser/pegTokenizer.pegjs.txt
@@ -854,13 +854,18 @@
855855 }
856856
857857 template_param
858 - = name:template_param_name space*
859 - value:( s0:"=" s1:space*
860 - //& { console.warn( 'entering value' ); return true }
861 - s2:template_param_text { return [s0, s1, s2] } )? {
 858+ = name:template_param_name
 859+ s0:space*
 860+ eq:"="?
 861+ s1:space*
 862+ value:template_param_text?
 863+
 864+ {
862865 //console.warn( 'named template_param matched' + pp([name, value ]) );
863866 if ( value !== '' ) {
864 - return new KV(name, flatten( value[2] ) || []);
 867+ return new KV( name, flatten( value ) );
 868+ } else if ( eq !== '' ) {
 869+ return new KV(flatten( name ), []);
865870 } else {
866871 return new KV([], flatten(name));
867872 }
@@ -1107,7 +1112,7 @@
11081113
11091114 generic_attribute_name
11101115 = & { return setFlag( 'equal' ) }
1111 - ! '/'
 1116+ ! '/>'
11121117 name:attribute_preprocessor_text_line
11131118 {
11141119 clearFlag( 'equal' );

Status & tagging log