@@ -256,7 +256,6 @@ class PickleTokenizer {
256
256
* @returns {PickleToken }
257
257
*/
258
258
errorToken ( message = "" ) {
259
- console . debug ( "errorToken()" , message ) ;
260
259
// always advance to allow more tokenizing
261
260
if ( this . bi == this . i ) this . i ++ ;
262
261
return this . makeToken ( "error" , this . string . slice ( this . bi , this . i ) , message || `unexpected ${ this . peek ( - 1 ) } ` ) ;
@@ -281,7 +280,6 @@ class PickleTokenizer {
281
280
this . bi = this . i ;
282
281
// Try colon block string, to allow colon in operators
283
282
if ( this . test ( / ^ : \s * \n / ) ) {
284
- console . debug ( "trying colon string" ) ;
285
283
var i = this . i ;
286
284
var lines = [ ] ;
287
285
this . chomp ( / ^ : \s * \n / ) ;
@@ -293,11 +291,9 @@ class PickleTokenizer {
293
291
indent = indent [ 0 ] ;
294
292
var ensure_same = / ^ ( [ \t ] ) \1* / . exec ( indent ) ;
295
293
if ( ! ensure_same ) return this . makeToken ( "error" , indent , "mix of tabs and spaces indenting block" ) ;
296
- console . debug ( "indent is" , indent . length , indent [ 0 ] == "\t" ? "tabs" : "spaces" ) ;
297
294
while ( true ) {
298
295
var line = this . chomp ( / ^ [ ^ \n ] * / ) ;
299
296
lines . push ( line [ 0 ] || "" ) ;
300
- console . debug ( "got line" , line [ 0 ] ) ;
301
297
if ( ! this . chomp ( "\n" ) ) break ;
302
298
if ( ! this . chomp ( indent ) ) {
303
299
var b = this . lineColumn ( ) ;
@@ -330,7 +326,6 @@ class PickleTokenizer {
330
326
{ type : "symbol.operator" , re : / ^ [ - ~ ` ! @ # $ % ^ & * _ + = [ \] | \\ : < > , . ? / ] + / , significant : true , groupNum : 0 } ,
331
327
]
332
328
for ( var { type, re, significant, groupNum } of TOKEN_REGEXES ) {
333
- console . debug ( "trying" , type ) ;
334
329
if ( this . test ( re ) ) {
335
330
var match = this . chomp ( re ) ;
336
331
if ( significant ) return this . makeToken ( type , match [ groupNum ] ) ;
@@ -339,11 +334,9 @@ class PickleTokenizer {
339
334
}
340
335
// Try strings
341
336
if ( this . test ( "{" ) ) {
342
- console . debug ( "trying brace string" ) ;
343
337
var j = 0 , depth = 0 , string = "" ;
344
338
do {
345
339
var ch = this . peek ( j ) ;
346
- console . debug ( "peek" , ch , "depth=" , depth ) ;
347
340
if ( ch == undefined ) return this . errorToken ( "unclosed {" ) ;
348
341
if ( ch == "{" ) depth ++ ;
349
342
else if ( ch == "}" ) depth -- ;
@@ -354,12 +347,10 @@ class PickleTokenizer {
354
347
return this . makeToken ( "string.curly" , string . slice ( 1 , - 1 ) ) ;
355
348
}
356
349
else if ( this . test ( / ^ [ ' " ] / ) ) {
357
- console . debug ( "trying quote string" ) ;
358
350
var q = this . chomp ( / ^ [ ' " ] / ) [ 0 ] ;
359
351
var j = 0 , string = "" ;
360
352
while ( true ) {
361
353
var ch = this . peek ( j ) ;
362
- console . debug ( "peek" , ch ) ;
363
354
// newlines must be backslash escaped
364
355
if ( ch == undefined || ch == "\n" ) {
365
356
this . i += j ;
0 commit comments