diff options
author | Anthon van der Neut <anthon@mnt.org> | 2021-05-06 08:36:49 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2021-05-06 08:36:49 +0200 |
commit | 17b35c376fd0fc9a94ba0adfdbf5bf63a6177dc9 (patch) | |
tree | 49a76a7328cbc20efde9603d5373ecf003adbbc6 /events.py | |
parent | 3d77f16e00124b74e150625396617b41e41da014 (diff) | |
download | ruamel.yaml-17b35c376fd0fc9a94ba0adfdbf5bf63a6177dc9.tar.gz |
* extend EOL token handling
* extending comment
Diffstat (limited to 'events.py')
-rw-r--r-- | events.py | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -7,6 +7,8 @@ from ruamel.yaml.compat import _F if False: # MYPY from typing import Any, Dict, Optional, List # NOQA +SHOW_LINES = False + def CommentCheck(): # type: () -> None @@ -37,6 +39,9 @@ class Event: arguments.append(_F('{key!s}={v!r}', key=key, v=v)) if self.comment not in [None, CommentCheck]: arguments.append('comment={!r}'.format(self.comment)) + if SHOW_LINES: + arguments.append('({}:{}/{}:{})'.format(self.start_mark.line, self.start_mark.column, + self.end_mark.line, self.end_mark.column)) arguments = ', '.join(arguments) else: attributes = [ |