mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-15 17:07:13 +08:00
Starting to refactor the normalizer to make sure that comments are also checked for indentation.
Using a linked list now for the indentation stack.
This commit is contained in:
@@ -4,14 +4,15 @@ if x > 2:
|
||||
if True:
|
||||
#: E111:5
|
||||
print
|
||||
#: E116:6
|
||||
#: E111:6
|
||||
#
|
||||
#: E116:2
|
||||
#: E111:2
|
||||
# what
|
||||
# Comment is fine
|
||||
# Comment is also fine
|
||||
|
||||
if False:
|
||||
pass
|
||||
print
|
||||
print
|
||||
# TODO this shouldn't actually be a 111 but an IndentationError. Please
|
||||
@@ -19,37 +20,40 @@ print
|
||||
#: E111:4
|
||||
print
|
||||
mimetype = 'application/x-directory'
|
||||
#: E116:5
|
||||
#: E111:5
|
||||
# 'httpd/unix-directory'
|
||||
create_date = False
|
||||
|
||||
def start(self):
|
||||
# foo
|
||||
#: E111:8
|
||||
# bar
|
||||
if True: # Hello
|
||||
self.master.start() # Comment
|
||||
# try:
|
||||
#: E116:12
|
||||
#: E111:12
|
||||
# self.master.start()
|
||||
# except MasterExit:
|
||||
#: E116:12
|
||||
#: E111:12
|
||||
# self.shutdown()
|
||||
# finally:
|
||||
#: E116:12
|
||||
#: E111:12
|
||||
# sys.exit()
|
||||
# Dedent to the first level
|
||||
#: E116:6
|
||||
#: E111:6
|
||||
# error
|
||||
# Dedent to the base level
|
||||
#: E116:2
|
||||
#: E111:2
|
||||
# Also wrongly indented.
|
||||
# Indent is correct.
|
||||
def start(self): # Correct comment
|
||||
if True:
|
||||
#: E115:0
|
||||
#: E111:0
|
||||
# try:
|
||||
#: E115:0
|
||||
#: E111:0
|
||||
# self.master.start()
|
||||
#: E115:0
|
||||
#: E111:0
|
||||
# except MasterExit:
|
||||
#: E115:0
|
||||
#: E111:0
|
||||
# self.shutdown()
|
||||
self.master.start() # comment
|
||||
|
||||
Reference in New Issue
Block a user