Rules: colons: Apply to '?' also

This commit is contained in:
Adrien Vergé
2016-01-19 19:45:13 +01:00
parent 9d8b0d4d2c
commit 8288a6f331
4 changed files with 37 additions and 11 deletions

View File

@@ -101,3 +101,15 @@ def get_comments_between_tokens(token1, token2, skip_first_line=False):
pointer += len(line) + 1
line_no += 1
column_no = 1
def is_explicit_key(token):
# explicit key:
# ? key
# : v
# or
# ?
# key
# : v
return (token.start_mark.pointer < token.end_mark.pointer and
token.start_mark.buffer[token.start_mark.pointer] == '?')