Whole file
t3rn0/ast-comments
The author described this change as “fix: spaces at the end of a comment does not change its inlined value”. It counts as a record because the check below fails on the code as it stood at 9db725c22 and passes on ed488312a, with nothing else changed between the two runs.
Projectt3rn0/ast-comments
Fix saved2023-09-23
Sharing licenceMIT · LICENSE
Change size+1 −1
What the code was meant to do, written into the code itself as a save note
fix: spaces at the end of a comment does not change its inlined value
The change
| 39 | 39 | end_lineno, end_col_offset = t.end | |
| 40 | 40 | c = Comment( | |
| 41 | 41 | value=t.string, | |
| 42 | - | inline=t.string != t.line.strip("\n").strip(" "), | |
| 42 | + | inline=t.string != t.line.strip("\n").lstrip(" "), | |
| 43 | 43 | lineno=lineno, | |
| 44 | 44 | col_offset=col_offset, | |
| 45 | 45 | end_lineno=end_lineno, |
The check that tells the two apart
fail→pass·test_parse.py::test_comment_ends_with_space
Check file test_parse.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it9db725c22bade2680147d760bfc2ff6e75d9a5f5
Broken version dated2023-06-24
Moduleast_comments
Units changed_enrich
Fingerprint8fd223012317ad44
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.