• Emmanuel T Odeke's avatar
    cmd/compile: fix label redefinition error column numbers · 0b63086f
    Emmanuel T Odeke authored
    Ensure that label redefinition error column numbers
    print the actual start of the label instead of the
    position of the label's delimiting token ":".
    
    For example, given this program:
    
    package main
    
    func main() {
    
                foo:
       foo:
    foo:
    foo            :
    }
    
    * Before:
    main.go:5:13: label foo defined and not used
    main.go:6:7: label foo already defined at main.go:5:13
    main.go:7:4: label foo already defined at main.go:5:13
    main.go:8:16: label foo already defined at main.go:5:13
    
    * After:
    main.go:5:13: label foo defined and not used
    main.go:6:4: label foo already defined at main.go:5:13
    main.go:7:1: label foo already defined at main.go:5:13
    main.go:8:1: label foo already defined at main.go:5:13
    
    Fixes #26411
    
    Change-Id: I8eb874b97fdc8862547176d57ac2fa0f075f2367
    Reviewed-on: https://go-review.googlesource.com/c/124595
    Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
    0b63086f
Name
Last commit
Last update
..
testdata Loading commit data...
branches.go Loading commit data...
dumper.go Loading commit data...
dumper_test.go Loading commit data...
error_test.go Loading commit data...
nodes.go Loading commit data...
nodes_test.go Loading commit data...
operator_string.go Loading commit data...
parser.go Loading commit data...
parser_test.go Loading commit data...
pos.go Loading commit data...
printer.go Loading commit data...
printer_test.go Loading commit data...
scanner.go Loading commit data...
scanner_test.go Loading commit data...
source.go Loading commit data...
syntax.go Loading commit data...
token_string.go Loading commit data...
tokens.go Loading commit data...