You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The scanner's interpretation of a //line directive that lacks a filename, such as this:
//line :1
is very surprising. I would have expected it to mean either "line 1 of the current
file", or "line 1 of the file specified by the previous //line
directive", but instead it means "line 1 of the directory containing the
current file". This is obviously nonsensical since directories don't have lines,
but this is actually seems to be the intended behaviour, if
go/scanner/scanner_test.go:497 is to be believed:
497: {"\n//line :1\n line1", "dir", 1},
I think this is a bug. I would prefer either of the two interpretations I suggested
over the current one.
(Why do I care? Because the cgo preprocessor emits files containing "//line
:1" prior to each field of a struct type. I suspect that is probably unintended
too, but that's another story.)
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: