mirror of
https://github.com/golang/go
synced 2024-11-24 16:00:12 -07:00
f8cf82f6f2
If a printer is configured with the SourcePos mode set, it will emit //-line comments as necessary to ensure that the result - if reparsed - reflects the original source position information. This change required a bit of reworking of the output section in printer.go. Specifically: - Introduced new Config mode 'SourcePos'. - Introduced new position 'out' which tracks the position of the generated output if it were read in again. If there is a discrepancy between out and the current AST/source position, a //line comment is emitted to correct for it. - Lazy emission of indentation so that //line comments can be placed correctly. As a result, the trimmer will have to do less work. - Merged writeItem into writeString. - Merged writeByteN into writeByte. - Use a []byte instead of a byte.Buffer both in the printer and in the trimmer (eliminates dependency). Also: introduced explicit printer.Mode type (in sync w/ parser.Mode, scanner.Mode, etc.) Runs all tests. Applied gofmt to src, misc w/o changes. Fixes #1047. Fixes #2697. R=rsc, rsc CC=golang-dev https://golang.org/cl/5643066 |
||
---|---|---|
.. | ||
articles | ||
codelab/wiki | ||
codewalk | ||
devel | ||
gopher | ||
play | ||
progs | ||
talks | ||
all.css | ||
button_background.png | ||
code.html | ||
codereview_with_mq.html | ||
community.html | ||
contrib.html | ||
contribute.html | ||
debugging_with_gdb.html | ||
docs.html | ||
effective_go.html | ||
effective_go.tmpl | ||
ExpressivenessOfGo.pdf | ||
frontpage.css | ||
gccgo_contribute.html | ||
gccgo_install.html | ||
go1.html | ||
go1.tmpl | ||
go1compat.html | ||
go_faq.html | ||
go_for_cpp_programmers.html | ||
go_mem.html | ||
go_spec.html | ||
go_tutorial.html | ||
go_tutorial.tmpl | ||
go-logo-black.png | ||
go-logo-blue.png | ||
go-logo-white.png | ||
godocs.js | ||
ie.css | ||
install.html | ||
logo-153x55.png | ||
logo.png | ||
Makefile | ||
makehtml | ||
play_overlay.png | ||
playground.html | ||
popups.js | ||
root.html | ||
sieve.gif | ||
tmpltohtml.go | ||
video-001.png | ||
video-002.png | ||
video-003.png | ||
video-004.png | ||
video-005.jpg |