r80427 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80426‎ | r80427 | r80428 >
Date:21:00, 16 January 2011
Author:platonides
Status:ok
Tags:
Comment:
The test {{Foo|[[[[bar]|baz]]}} added in r80417 actually didn't pass.
breakSyntax() didn't readd the | of part nodes.
Modified paths:
  • /trunk/extensions/NativePreprocessor/nodes.h (modified) (history)
  • /trunk/extensions/NativePreprocessor/preprocesstoobj.c (modified) (history)

Diff [purge]

Index: trunk/extensions/NativePreprocessor/preprocesstoobj.c
@@ -652,7 +652,7 @@
653653 } else {
654654 // Count is less than the maximum
655655 // Skip any gaps in the callback array to find the true largest match
656 - matchingCount = count;
 656+
657657 /* Known rules: If we have three opening braces but only two closing ones, we want the two.
658658 * With less than the minimum, matchingCount = 0.
659659 */
Index: trunk/extensions/NativePreprocessor/nodes.h
@@ -259,8 +259,14 @@
260260 }
261261
262262 /* Go for part nodes */
263 - while ( readpos < *nodeStringLen ) {
264 - readpos += NODE_LEN; /* <part> */
 263+ while ( readpos < *nodeStringLen ) {printf("breakSyntaw(%.*s) %d %d\n", *nodeStringLen, nodeString, readpos, writepos);
 264+ assert( nodeString[readpos] == part_node ); /* <part> node */
 265+ assert( !memcmp( nodeString + readpos + 8, "00000001", 8 ) ); /* Part nodes contain exactly one character (the pipe) */
 266+ node->contentLength = 1;
 267+ serializeNode( nodeString + writepos, node );
 268+ readpos += NODE_LEN;
 269+ writepos += NODE_LEN;
 270+
265271 assert( readpos < *nodeStringLen ); /* All part nodes contain one name node inside */
266272 int nameChildren = getNextSibling( nodeString + readpos ); /* <name> */
267273 readpos += NODE_LEN;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r80417Another couple of tests. Also passed by the NtPrepro :)platonides18:20, 16 January 2011

Status & tagging log