-
Dhananjay Nakrani authored
Currently, it separates comments from rest of the AST. This causes problems when long counter increment statements are added before compiler directives. See Issue #17315. This change moves comments handling into AST Visitor so that when printer prints code from AST, position of compiler directives relative to the associated function is preserved. Tested with https://gist.github.com/dhananjay92/837df6bc1f171b1350f85d7a7d59ca1e and unit test. Fixes #17315 Change-Id: I61a80332fc1923de6fc59ff63b953671598071fa Reviewed-on: https://go-review.googlesource.com/30161Reviewed-by: Rob Pike <r@golang.org>
f0636bf6