Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
go/scanner: report errors for incorrect line directives
Based on decision for #24183. This makes the go/scanner behavior match cmd/compile behavior. Adjusted a go/printer test that assumed silent behavior for invalid line directive, and added more scanner tests verifying the correct error position and message for invalid line directives. The filenames in line directives now remain untouched by the scanner; there is no cleanup or conversion of relative into absolute paths anymore, in sync with what the compiler's scanner/parser are doing. Any kind of filename transformation has to be done by a client. This makes the scanner code simpler and also more predictable. For #24183. Change-Id: Ia091548e1d3d89dfdf6e7d82dab50bea05742ce3 Reviewed-on: https://go-review.googlesource.com/100235 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
- Loading branch information
Showing
4 changed files
with
77 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters