• Robert Griesemer's avatar
    go/printer: simplify handling of line directives · 53c41639
    Robert Griesemer authored
    Strangely enough, the existing implementation used adjusted (by line
    directives) source positions to determine layout and thus required
    position corrections when printing a line directive.
    
    Instead, just use the unadjusted, absolute source positions and then
    printing a line directive doesn't require any adjustments, only some
    care to make sure it remains in column 1 as before.
    
    The new code doesn't need to parse line directives anymore and simply
    ensures that comments with the //line prefix and starting in column 1
    remain in that position. That is a slight change from the old behavior
    (which ignored incorrect line directives, e.g. because they had an
    invalid line number) but unlikely to show up in real code.
    
    This is prep work for handling of line directives that also specify
    columns (which now won't require much special handling anymore).
    
    For #24143.
    
    Change-Id: I07eb2e1b35b37337e632e3dbf5b70c783c615f8a
    Reviewed-on: https://go-review.googlesource.com/99621Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
    53c41639
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...