We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
in_string
1 parent c86fa00 commit 5bb2842Copy full SHA for 5bb2842
Lib/pdb.py
@@ -762,6 +762,11 @@ def input_auto_indent():
762
# If the last line is empty, we don't need to indent
763
return
764
765
+ # A stack to keep track of string delimiters (quotes). Push a
766
+ # quote when entering a string, and pop it when the string
767
+ # ends. When the stack is empty, we're not inside a string. If
768
+ # encounter a '#' while not inside a string, it's a comment
769
+ # start; otherwise, it's just a '#' character within a string.
770
in_string: list[str] = []
771
last_char = None
772
last_line = last_line.rstrip('\r\n')
0 commit comments