aboutsummaryrefslogtreecommitdiff
path: root/test/import5.go
AgeCommit message (Collapse)Author
2017-03-24cmd/compile: be slightly more tolerant in case of certain syntax errorsRobert Griesemer
Avoid construction of incorrect syntax trees in presence of errors. For #19663. Change-Id: I43025a3cf0fe02cae9a57e8bb9489b5f628c3fd7 Reviewed-on: https://go-review.googlesource.com/38604 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-02-10cmd/compile/internal/syntax: removed gcCompat code needed to pass orig. testsRobert Griesemer
The gcCompat mode was introduced to match the new parser's node position setup exactly with the positions used by the original parser. Some of the gcCompat adjustments were required to satisfy syntax error test cases, and the rest were required to make toolstash cmp pass. This change removes the former gcCompat adjustments and instead adjusts the respective test cases as necessary. In some cases this makes the error lines consistent with the ones reported by gccgo. Where it has changed, the position associated with a given syntactic construct is the position (line/col number) of the left-most token belonging to the construct. Change-Id: I5b60c00c5999a895c4d6d6e9b383c6405ccf725c Reviewed-on: https://go-review.googlesource.com/36695 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2012-02-29gc: disallow absolute import pathsRuss Cox
They are broken and hard to make work. They have never worked: if you import "/tmp/x" from "/home/rsc/p.c" then the compiler rewrites this into import "/home/rsc/tmp/x", which is clearly wrong. Also we just disallowed the : character in import paths, so import "c:/foo" is already not allowed. Finally, in order to support absolute paths well in a build tool we'd have to provide a mechanism to instruct the compiler to resolve absolute imports by looking in some other tree (where the binaries live) and provide a mapping from absolute path to location in that tree. This CL avoids adding that complexity. This is not part of the language spec (and should not be), so no spec change is needed. If we need to make them work later, we can. R=ken2 CC=golang-dev https://golang.org/cl/5712043
2012-02-24gc: reject import paths containing special charactersAnthony Martin
Also allow multiple invalid import statements in a single file. Fixes #3021. The changes to go/parser and the language specifcation have already been committed. R=rsc, gri CC=golang-dev https://golang.org/cl/5672084
2012-02-23test: commentary for [h-m]*.goRob Pike
R=golang-dev, gri CC=golang-dev https://golang.org/cl/5674112
2012-02-16test: use testlib (fourth 100)Russ Cox
X ,s;^// \$G (\$D/)?\$F\.go *$;// compile;g X ,s;^// \$G (\$D/)?\$F\.go && \$L \$F\.\$A *$;// build;g X ,s;^// \$G (\$D/)?\$F\.go && \$L \$F\.\$A && \./\$A\.out *$;// run;g X ,s;^// errchk \$G( -e)? (\$D/)?\$F\.go *$;// errorcheck;g R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5673079
2012-01-31gc: diagnose \ in import pathRuss Cox
R=ken2 CC=golang-dev https://golang.org/cl/5609044