• Martin Möhrmann's avatar
    cmd/compile: cleanup pragcgo · 07669d27
    Martin Möhrmann authored
    Removes dynimport, dynexport, dynlinker cases since they can not
    be reached due to prefix check for "go:cgo_" in getlinepragma.
    
    Replaces the if chains for verb distinction by a switch statement.
    Replaces fmt.Sprintf by fmt.Sprintln for string concatenation.
    
    Removes the more, getimpsym and getquoted functions by introducing a
    pragmaFields function that partitions a pragma into its components.
    
    Adds tests for cgo pragmas.
    
    Change-Id: I43c7b9550feb3ddccaff7fb02198a3f994444123
    Reviewed-on: https://go-review.googlesource.com/21607Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
    Run-TryBot: Matthew Dempsky <mdempsky@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    07669d27
lex_test.go 2.38 KB