Index: trunk/phase3/tests/phpunit/includes/parser/PreprocessorTest.php |
— | — | @@ -80,6 +80,8 @@ |
81 | 81 | array( "{{#if: {{{1|}}} | Foo | [[Bar]] }}", "<root><template><title>#if: <tplarg><title>1</title><part><name index=\"1\" /><value></value></part></tplarg> </title><part><name index=\"1\" /><value> Foo </value></part><part><name index=\"2\" /><value> [[Bar]] </value></part></template></root>"), |
82 | 82 | array( "{{#if: {{{1|}}} | [[Foo]] | Bar }}", "<root><template><title>#if: <tplarg><title>1</title><part><name index=\"1\" /><value></value></part></tplarg> </title><part><name index=\"1\" /><value> [[Foo]] </value></part><part><name index=\"2\" /><value> Bar </value></part></template></root>"), |
83 | 83 | array( "{{#if: {{{1|}}} | 1 | {{#if: {{{1|}}} | 2 | 3 }} }}", "<root><template><title>#if: <tplarg><title>1</title><part><name index=\"1\" /><value></value></part></tplarg> </title><part><name index=\"1\" /><value> 1 </value></part><part><name index=\"2\" /><value> <template><title>#if: <tplarg><title>1</title><part><name index=\"1\" /><value></value></part></tplarg> </title><part><name index=\"1\" /><value> 2 </value></part><part><name index=\"2\" /><value> 3 </value></part></template> </value></part></template></root>"), |
| 84 | + array( "{{ {{Foo}}", "<root>{{ <template><title>Foo</title></template></root>"), |
| 85 | + array( "{{Foobar {{Foo}} {{Bar}} {{Baz}} ", "<root>{{Foobar <template><title>Foo</title></template> <template><title>Bar</title></template> <template><title>Baz</title></template> </root>"), |
84 | 86 | /* array( file_get_contents( dirname( __FILE__ ) . '/QuoteQuran.txt' ), file_get_contents( dirname( __FILE__ ) . '/QuoteQuranExpanded.txt' ) ), */ |
85 | 87 | ); |
86 | 88 | } |
Index: trunk/extensions/NativePreprocessor/nodes.h |
— | — | @@ -214,10 +214,12 @@ |
215 | 215 | |
216 | 216 | /** |
217 | 217 | * Get the nextSibling value from a node serialized at pointer. |
| 218 | + * The nextSibling is a hexadecimal value in bytes 2-7, forming a |
| 219 | + * value from 0 to 0x01000000. |
218 | 220 | */ |
219 | 221 | static inline int getNextSibling(const char* pointer) { |
220 | 222 | assert( pointer[2] != '?' ); |
221 | | - return ( ( ( ( ( hex2dec(pointer[2]) << 4 ) | hex2dec(pointer[3]) << 4 ) | hex2dec(pointer[4]) << 4 ) | hex2dec(pointer[5]) << 4 ) | hex2dec(pointer[6]) << 4 ) | hex2dec(pointer[7]); |
| 223 | + return ( ( ( ( ( hex2dec(pointer[2]) << 4 ) | hex2dec(pointer[3]) ) << 4 | hex2dec(pointer[4]) ) << 4 | hex2dec(pointer[5]) ) << 4 | hex2dec(pointer[6]) ) << 4 | hex2dec(pointer[7]); |
222 | 224 | } |
223 | 225 | |
224 | 226 | /** |