summaryrefslogtreecommitdiff
path: root/tokens.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2021-03-26 11:20:38 +0100
committerAnthon van der Neut <anthon@mnt.org>2021-03-26 11:20:38 +0100
commit09f8576ae990234daebf51cca48b52d564f2c2d2 (patch)
treee08953ec5547d9ed05373a3134c3557f6ebf11c6 /tokens.py
parente8719cd39655d98cf2bde1be15366cca7a58fd89 (diff)
downloadruamel.yaml-09f8576ae990234daebf51cca48b52d564f2c2d2.tar.gz
remove support for 2.7, prepare for f-strings0.17.0
Diffstat (limited to 'tokens.py')
-rw-r--r--tokens.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tokens.py b/tokens.py
index 3d3c566..19a2572 100644
--- a/tokens.py
+++ b/tokens.py
@@ -37,6 +37,14 @@ class Token(object):
pass
return '{}({})'.format(self.__class__.__name__, arguments)
+ @property
+ def column(self):
+ return self.start_mark.column
+
+ @column.setter
+ def column(self, pos):
+ self.start_mark.column = pos
+
def add_post_comment(self, comment):
# type: (Any) -> None
if not hasattr(self, '_comment'):
@@ -267,6 +275,9 @@ class CommentToken(Token):
if SHOWLINES:
try:
v += ', line: ' + str(self.start_mark.line)
+ except: # NOQA
+ pass
+ try:
v += ', col: ' + str(self.start_mark.column)
except: # NOQA
pass