Index: trunk/extensions/VisualEditor/modules/parser/mediawiki.TokenTransformManager.js |
— | — | @@ -443,8 +443,8 @@ |
444 | 444 | AsyncTokenTransformManager.prototype.onChunk = function ( tokens ) { |
445 | 445 | // Set top-level callback to next transform phase |
446 | 446 | var res = this.transformTokens ( tokens, this.tokenCB ); |
447 | | - this.env.dp('AsyncTokenTransformManager onChunk res.async=' + res.async + |
448 | | - ' tokens=' + JSON.stringify( tokens ) ); |
| 447 | + this.env.dp( 'AsyncTokenTransformManager onChunk res.async=', |
| 448 | + res.async, ' tokens=', tokens ); |
449 | 449 | |
450 | 450 | if ( ! this.tailAccumulator ) { |
451 | 451 | this.emit( 'chunk', res.tokens ); |
— | — | @@ -574,8 +574,8 @@ |
575 | 575 | // tokens.pop(); |
576 | 576 | //} |
577 | 577 | |
578 | | - this.env.dp('AsyncTokenTransformManager._returnTokens, emitting chunk: ' + |
579 | | - JSON.stringify( tokens ) ); |
| 578 | + this.env.dp( 'AsyncTokenTransformManager._returnTokens, emitting chunk: ', |
| 579 | + tokens ); |
580 | 580 | |
581 | 581 | this.emit( 'chunk', tokens ); |
582 | 582 | |
— | — | @@ -607,7 +607,7 @@ |
608 | 608 | } else { |
609 | 609 | // nothing was asynchronous, so we'll have to emit end here. |
610 | 610 | this.env.dp( 'AsyncTokenTransformManager.onEndEvent: synchronous done', |
611 | | - this.loopAndDepthCheck ); |
| 611 | + this.loopAndDepthCheck ); |
612 | 612 | this.emit('end'); |
613 | 613 | this._reset(); |
614 | 614 | } |
— | — | @@ -658,8 +658,7 @@ |
659 | 659 | * @param {Array} Token chunk. |
660 | 660 | */ |
661 | 661 | SyncTokenTransformManager.prototype.onChunk = function ( tokens ) { |
662 | | - this.env.dp('SyncTokenTransformManager.onChunk, input: ' + |
663 | | - JSON.stringify( tokens, null, 2 ) ); |
| 662 | + this.env.dp( 'SyncTokenTransformManager.onChunk, input: ', tokens ); |
664 | 663 | var res, |
665 | 664 | localAccum = [], |
666 | 665 | localAccumLength = 0, |
— | — | @@ -717,8 +716,7 @@ |
718 | 717 | } |
719 | 718 | } |
720 | 719 | } |
721 | | - this.env.dp( 'SyncTokenTransformManager.onChunk: emitting ' + |
722 | | - JSON.stringify( localAccum, null, 2 ) ); |
| 720 | + this.env.dp( 'SyncTokenTransformManager.onChunk: emitting ', localAccum ); |
723 | 721 | this.emit( 'chunk', localAccum ); |
724 | 722 | }; |
725 | 723 | |
— | — | @@ -941,10 +939,8 @@ |
942 | 940 | //console.warn( 'TokenAccumulator._returnTokens' ); |
943 | 941 | if ( reference === 'child' ) { |
944 | 942 | tokens = tokens.concat( this.accum ); |
945 | | - this.manager.env.dp('TokenAccumulator._returnTokens child: ' + |
946 | | - JSON.stringify( tokens, null, 2 ) + |
947 | | - ' outstanding: ' + this.outstanding |
948 | | - ); |
| 943 | + this.manager.env.dp( 'TokenAccumulator._returnTokens child: ', |
| 944 | + tokens, ' outstanding: ', this.outstanding ); |
949 | 945 | this.accum = []; |
950 | 946 | this.parentCB( tokens, this.outstanding ); |
951 | 947 | return null; |
— | — | @@ -954,15 +950,15 @@ |
955 | 951 | tokens = this.accum.concat( tokens ); |
956 | 952 | // A sibling will transform tokens, so we don't have to do this |
957 | 953 | // again. |
958 | | - this.manager.env.dp( 'TokenAccumulator._returnTokens: ' + |
959 | | - 'sibling done and parentCB ' + |
960 | | - JSON.stringify( tokens ) ); |
| 954 | + this.manager.env.dp( 'TokenAccumulator._returnTokens: ', |
| 955 | + 'sibling done and parentCB ', |
| 956 | + tokens ); |
961 | 957 | this.parentCB( tokens, false ); |
962 | 958 | return null; |
963 | 959 | } else if ( this.outstanding === 1 && notYetDone ) { |
964 | | - this.manager.env.dp( 'TokenAccumulator._returnTokens: ' + |
965 | | - 'sibling done and parentCB but notYetDone ' + |
966 | | - JSON.stringify( tokens ) ); |
| 960 | + this.manager.env.dp( 'TokenAccumulator._returnTokens: ', |
| 961 | + 'sibling done and parentCB but notYetDone ', |
| 962 | + tokens ); |
967 | 963 | // Sibling is not yet done, but child is. Return own parentCB to |
968 | 964 | // allow the sibling to go direct, and call back parent with |
969 | 965 | // tokens. The internal accumulator is empty at this stage, as its |
— | — | @@ -970,11 +966,9 @@ |
971 | 967 | return this.parentCB( tokens, true); |
972 | 968 | } else { |
973 | 969 | this.accum = this.accum.concat( tokens ); |
974 | | - this.manager.env.dp( 'TokenAccumulator._returnTokens: sibling done, but not overall. notYetDone=' + |
975 | | - notYetDone + ', this.outstanding=' + this.outstanding + |
976 | | - ', this.accum=' + |
977 | | - JSON.stringify( this.accum, null, 2 ) + |
978 | | - ' manager.title=', this.manager.title ); |
| 970 | + this.manager.env.dp( 'TokenAccumulator._returnTokens: sibling done, but not overall. notYetDone=', |
| 971 | + notYetDone, ', this.outstanding=', this.outstanding, |
| 972 | + ', this.accum=', this.accum, ' manager.title=', this.manager.title ); |
979 | 973 | } |
980 | 974 | |
981 | 975 | |
Index: trunk/extensions/VisualEditor/modules/parser/pegTokenizer.pegjs.txt |
— | — | @@ -489,7 +489,7 @@ |
490 | 490 | return [new TagTk( 'h' + level )] |
491 | 491 | .concat(c, [new EndTagTk( 'h' + level ), spc]); |
492 | 492 | } |
493 | | - / & { dp('nomatch exit h'); clearFlag('h'); return false } { return null } |
| 493 | + / & { /* dp('nomatch exit h'); */ clearFlag('h'); return false } { return null } |
494 | 494 | ) { return r } |
495 | 495 | |
496 | 496 | comment |
— | — | @@ -1239,7 +1239,7 @@ |
1240 | 1240 | = tas:table_start space* c:table_caption? b:table_body? te:table_end { |
1241 | 1241 | var res = new TagTk( 'table' ); |
1242 | 1242 | var body = b !== '' ? b : []; |
1243 | | - dp("body: " + pp(body)); |
| 1243 | + //dp("body: " + pp(body)); |
1244 | 1244 | if (tas.length > 0) { |
1245 | 1245 | // FIXME: actually parse and build structure |
1246 | 1246 | //res.attribs = [new KV('data-unparsed', tas.join(''))]; |
— | — | @@ -1263,7 +1263,7 @@ |
1264 | 1264 | & { setFlag('table'); return true; } |
1265 | 1265 | ta:generic_attribute* |
1266 | 1266 | { |
1267 | | - dp("table_start " + pp(ta) + ", pos:" + pos); |
| 1267 | + //dp("table_start " + pp(ta) + ", pos:" + pos); |
1268 | 1268 | return ta; |
1269 | 1269 | } |
1270 | 1270 | / & { clearFlag('table'); return false; } { return null; } |
Index: trunk/extensions/VisualEditor/modules/parser/ext.core.AttributeExpander.js |
— | — | @@ -54,13 +54,13 @@ |
55 | 55 | if( atm.process( token.attribs ) ) { |
56 | 56 | // Attributes were transformed synchronously |
57 | 57 | this.manager.env.dp ( |
58 | | - 'sync attribs for ' + JSON.stringify( token ) |
| 58 | + 'sync attribs for ', token |
59 | 59 | ); |
60 | 60 | // All attributes are fully expanded synchronously (no IO was needed) |
61 | 61 | return { token: token }; |
62 | 62 | } else { |
63 | 63 | // Async attribute expansion is going on |
64 | | - this.manager.env.dp( 'async return for ' + JSON.stringify( token )); |
| 64 | + this.manager.env.dp( 'async return for ', token ); |
65 | 65 | expandData.async = true; |
66 | 66 | return { async: true }; |
67 | 67 | } |
— | — | @@ -76,8 +76,7 @@ |
77 | 77 | AttributeExpander.prototype._returnAttributes = function ( expandData, |
78 | 78 | attributes ) |
79 | 79 | { |
80 | | - this.manager.env.dp( 'AttributeExpander._returnAttributes: ' + |
81 | | - JSON.stringify(attributes) ); |
| 80 | + this.manager.env.dp( 'AttributeExpander._returnAttributes: ',attributes ); |
82 | 81 | // Remove the target from the attributes |
83 | 82 | expandData.token.attribs = attributes; |
84 | 83 | if ( expandData.async ) { |
Index: trunk/extensions/VisualEditor/modules/parser/ext.core.TemplateHandler.js |
— | — | @@ -78,8 +78,8 @@ |
79 | 79 | attributes = attributes.concat( this._nameArgs( token.attribs ) ); |
80 | 80 | } |
81 | 81 | |
82 | | - this.manager.env.dp( 'before AttributeTransformManager: ' + |
83 | | - JSON.stringify( attributes, null, 2 ) ); |
| 82 | + this.manager.env.dp( 'before AttributeTransformManager: ', |
| 83 | + attributes ); |
84 | 84 | new AttributeTransformManager( |
85 | 85 | this.manager, |
86 | 86 | this._returnAttributes.bind( this, tplExpandData ) |
— | — | @@ -88,15 +88,14 @@ |
89 | 89 | // Unblock finish |
90 | 90 | if ( ! tplExpandData.attribsAsync ) { |
91 | 91 | // Attributes were transformed synchronously |
92 | | - this.manager.env.dp ( |
93 | | - 'sync attribs for ' + JSON.stringify( tplExpandData.target ), |
| 92 | + this.manager.env.dp ( 'sync attribs for ', tplExpandData.target, |
94 | 93 | tplExpandData.expandedArgs |
95 | 94 | ); |
96 | 95 | // All attributes are fully expanded synchronously (no IO was needed) |
97 | 96 | return this._expandTemplate ( tplExpandData ); |
98 | 97 | } else { |
99 | 98 | // Async attribute expansion is going on |
100 | | - this.manager.env.dp( 'async return for ' + JSON.stringify( token )); |
| 99 | + this.manager.env.dp( 'async return for ', token ); |
101 | 100 | tplExpandData.overallAsync = true; |
102 | 101 | return { async: true }; |
103 | 102 | } |
— | — | @@ -117,7 +116,7 @@ |
118 | 117 | out.push( attribs[i] ); |
119 | 118 | } |
120 | 119 | } |
121 | | - this.manager.env.dp( '_nameArgs: ' + JSON.stringify( out ) ); |
| 120 | + this.manager.env.dp( '_nameArgs: ', out ); |
122 | 121 | return out; |
123 | 122 | }; |
124 | 123 | |
— | — | @@ -127,7 +126,7 @@ |
128 | 127 | TemplateHandler.prototype._returnAttributes = function ( tplExpandData, |
129 | 128 | attributes ) |
130 | 129 | { |
131 | | - this.manager.env.dp( 'TemplateHandler._returnAttributes: ' + JSON.stringify(attributes) ); |
| 130 | + this.manager.env.dp( 'TemplateHandler._returnAttributes: ', attributes ); |
132 | 131 | // Remove the target from the attributes |
133 | 132 | tplExpandData.attribsAsync = false; |
134 | 133 | tplExpandData.target = attributes[0].v; |
— | — | @@ -149,8 +148,7 @@ |
150 | 149 | |
151 | 150 | |
152 | 151 | if ( ! tplExpandData.target ) { |
153 | | - this.manager.env.dp( 'No target! ' + |
154 | | - JSON.stringify( tplExpandData, null, 2 ) ); |
| 152 | + this.manager.env.dp( 'No target! ', tplExpandData ); |
155 | 153 | console.trace(); |
156 | 154 | } |
157 | 155 | |
— | — | @@ -179,12 +177,12 @@ |
180 | 178 | |
181 | 179 | // XXX: support async parser functions! |
182 | 180 | if ( tplExpandData.overallAsync ) { |
183 | | - this.manager.env.dp( 'TemplateHandler._expandTemplate: calling back ' + |
184 | | - 'after parser func ' + prefix + ' with res:' + JSON.stringify( res ) ); |
| 181 | + this.manager.env.dp( 'TemplateHandler._expandTemplate: calling back ', |
| 182 | + 'after parser func ', prefix, ' with res:', res ); |
185 | 183 | return tplExpandData.cb( res, false ); |
186 | 184 | } else { |
187 | | - this.manager.env.dp( 'TemplateHandler._expandTemplate: sync return ' + |
188 | | - 'after parser func ' + prefix + ' with res:' + JSON.stringify( res ) ); |
| 185 | + this.manager.env.dp( 'TemplateHandler._expandTemplate: sync return ', |
| 186 | + 'after parser func ', prefix, ' with res:', res ); |
189 | 187 | return { tokens: res }; |
190 | 188 | //data.reset(); |
191 | 189 | } |
— | — | @@ -249,13 +247,13 @@ |
250 | 248 | if ( tplExpandData.overallAsync || |
251 | 249 | ! tplExpandData.expandDone ) { |
252 | 250 | tplExpandData.overallAsync = true; |
253 | | - this.manager.env.dp( 'Async return from _expandTemplate for ' + |
254 | | - JSON.stringify ( tplExpandData.target ) ); |
| 251 | + this.manager.env.dp( 'Async return from _expandTemplate for ', |
| 252 | + tplExpandData.target ); |
255 | 253 | return { async: true }; |
256 | 254 | } else { |
257 | | - this.manager.env.dp( 'Sync return from _expandTemplate for ' + |
258 | | - JSON.stringify( tplExpandData.target ) + ' : ' + |
259 | | - JSON.stringify( tplExpandData.result ) |
| 255 | + this.manager.env.dp( 'Sync return from _expandTemplate for ', |
| 256 | + tplExpandData.target, ' : ', |
| 257 | + tplExpandData.result |
260 | 258 | ); |
261 | 259 | return tplExpandData.result; |
262 | 260 | } |
— | — | @@ -267,7 +265,7 @@ |
268 | 266 | */ |
269 | 267 | TemplateHandler.prototype._onChunk = function( tplExpandData, chunk ) { |
270 | 268 | // We encapsulate the output by default, so collect tokens here. |
271 | | - this.manager.env.dp( 'TemplateHandler._onChunk' + JSON.stringify( chunk ) ); |
| 269 | + this.manager.env.dp( 'TemplateHandler._onChunk', chunk ); |
272 | 270 | tplExpandData.resultTokens = tplExpandData.resultTokens.concat( chunk ); |
273 | 271 | }; |
274 | 272 | |
— | — | @@ -276,7 +274,7 @@ |
277 | 275 | * the template source. |
278 | 276 | */ |
279 | 277 | TemplateHandler.prototype._onEnd = function( tplExpandData, token ) { |
280 | | - this.manager.env.dp( 'TemplateHandler._onEnd' + JSON.stringify( tplExpandData.resultTokens ) ); |
| 278 | + this.manager.env.dp( 'TemplateHandler._onEnd', tplExpandData.resultTokens ); |
281 | 279 | tplExpandData.expandDone = true; |
282 | 280 | var res = tplExpandData.resultTokens; |
283 | 281 | // Strip 'end' tokens and trailing newlines |
— | — | @@ -296,8 +294,7 @@ |
297 | 295 | //console.warn( 'TemplateHandler._onEnd: ' + JSON.stringify( res, null, 2 ) ); |
298 | 296 | |
299 | 297 | if ( tplExpandData.overallAsync ) { |
300 | | - this.manager.env.dp( 'TemplateHandler._onEnd: calling back with res:' + |
301 | | - JSON.stringify( res ) ); |
| 298 | + this.manager.env.dp( 'TemplateHandler._onEnd: calling back with res:', res ); |
302 | 299 | tplExpandData.cb( res, false ); |
303 | 300 | } else { |
304 | 301 | this.manager.env.dp( 'TemplateHandler._onEnd: synchronous return!' ); |
— | — | @@ -313,7 +310,7 @@ |
314 | 311 | */ |
315 | 312 | TemplateHandler.prototype._processTemplateAndTitle = function( pipeline, src, title ) { |
316 | 313 | // Feed the pipeline. XXX: Support different formats. |
317 | | - this.manager.env.dp( 'TemplateHandler._processTemplateAndTitle: ' + src ); |
| 314 | + this.manager.env.dp( 'TemplateHandler._processTemplateAndTitle: ', src ); |
318 | 315 | pipeline.process ( src ); |
319 | 316 | }; |
320 | 317 | |
— | — | @@ -340,10 +337,10 @@ |
341 | 338 | // We are about to start an async request for a template, so mark this |
342 | 339 | // template expansion as such. |
343 | 340 | tplExpandData.overallAsync = true; |
344 | | - this.manager.env.dp( 'Note: trying to fetch ' + title ); |
| 341 | + this.manager.env.dp( 'Note: trying to fetch ', title ); |
345 | 342 | |
346 | 343 | // Start a new request if none is outstanding |
347 | | - this.manager.env.dp( 'requestQueue: ', this.manager.env.requestQueue); |
| 344 | + this.manager.env.dp( 'requestQueue: ', this.manager.env.requestQueue ); |
348 | 345 | if ( this.manager.env.requestQueue[title] === undefined ) { |
349 | 346 | this.manager.env.tp( 'Note: Starting new request for ' + title ); |
350 | 347 | this.manager.env.requestQueue[title] = new TemplateRequest( this.manager, title ); |
— | — | @@ -393,8 +390,8 @@ |
394 | 391 | res = this.manager.args[argName]; |
395 | 392 | } else { |
396 | 393 | var defaultValue = (attributes[1] && ! attributes[1].k.length && attributes[1].v) || false; |
397 | | - this.manager.env.dp( 'templateArg not found: ' + argName + |
398 | | - ' vs. ' + JSON.stringify( defaultValue ) ); |
| 394 | + this.manager.env.dp( 'templateArg not found: ', argName, |
| 395 | + ' vs. ', defaultValue ); |
399 | 396 | if ( defaultValue ) { |
400 | 397 | res = defaultValue; |
401 | 398 | } else { |
— | — | @@ -474,7 +471,7 @@ |
475 | 472 | // XXX: handle other status codes |
476 | 473 | |
477 | 474 | // Remove self from request queue |
478 | | - manager.env.dp( 'trying to remove ' + title + ' from requestQueue' ); |
| 475 | + manager.env.dp( 'trying to remove ', title, ' from requestQueue' ); |
479 | 476 | delete manager.env.requestQueue[title]; |
480 | 477 | manager.env.dp( 'after deletion:', manager.env.requestQueue ); |
481 | 478 | }); |