Show More
@@ -351,8 +351,7 b' class IPythonConsoleLexer(Lexer):' | |||
|
351 | 351 | # To reduce the number of regex match checks, we have multiple |
|
352 | 352 | # 'if' blocks instead of 'if-elif' blocks. |
|
353 | 353 | |
|
354 |
|
|
|
355 | ### | |
|
354 | # Check for possible end of input | |
|
356 | 355 | in2_match = self.in2_regex.match(line) |
|
357 | 356 | in2_match_rstrip = self.in2_regex_rstrip.match(line) |
|
358 | 357 | if (in2_match and in2_match.group().rstrip() == line.rstrip()) or \ |
@@ -368,8 +367,7 b' class IPythonConsoleLexer(Lexer):' | |||
|
368 | 367 | insertion = (0, Generic.Prompt, line) |
|
369 | 368 | return mode, code, insertion |
|
370 | 369 | |
|
371 |
|
|
|
372 | ### | |
|
370 | # Check for output prompt | |
|
373 | 371 | out_match = self.out_regex.match(line) |
|
374 | 372 | out_match_rstrip = self.out_regex_rstrip.match(line) |
|
375 | 373 | if out_match or out_match_rstrip: |
@@ -385,8 +383,7 b' class IPythonConsoleLexer(Lexer):' | |||
|
385 | 383 | return mode, code, insertion |
|
386 | 384 | |
|
387 | 385 | |
|
388 |
|
|
|
389 | ### | |
|
386 | # Check for input or continuation prompt (non stripped version) | |
|
390 | 387 | in1_match = self.in1_regex.match(line) |
|
391 | 388 | if in1_match or (in2_match and self.mode != 'tb'): |
|
392 | 389 | # New input or when not in tb, continued input. |
@@ -401,8 +398,7 b' class IPythonConsoleLexer(Lexer):' | |||
|
401 | 398 | insertion = (0, Generic.Prompt, line[:idx]) |
|
402 | 399 | return mode, code, insertion |
|
403 | 400 | |
|
404 |
|
|
|
405 | ### | |
|
401 | # Check for input or continuation prompt (stripped version) | |
|
406 | 402 | in1_match_rstrip = self.in1_regex_rstrip.match(line) |
|
407 | 403 | if in1_match_rstrip or (in2_match_rstrip and self.mode != 'tb'): |
|
408 | 404 | # New input or when not in tb, continued input. |
@@ -417,16 +413,14 b' class IPythonConsoleLexer(Lexer):' | |||
|
417 | 413 | insertion = (0, Generic.Prompt, line[:idx]) |
|
418 | 414 | return mode, code, insertion |
|
419 | 415 | |
|
420 |
|
|
|
421 | ### | |
|
416 | # Check for traceback | |
|
422 | 417 | if self.ipytb_start.match(line): |
|
423 | 418 | mode = 'tb' |
|
424 | 419 | code = line |
|
425 | 420 | insertion = None |
|
426 | 421 | return mode, code, insertion |
|
427 | 422 | |
|
428 |
|
|
|
429 | ### | |
|
423 | # All other stuff... | |
|
430 | 424 | if self.mode in ('input', 'output'): |
|
431 | 425 | # We assume all other text is output. Multiline input that |
|
432 | 426 | # does not use the continuation marker cannot be detected. |
General Comments 0
You need to be logged in to leave comments.
Login now