1. 20 Feb, 2019 1 commit
  2. 19 Feb, 2019 12 commits
  3. 17 Feb, 2019 2 commits
  4. 16 Feb, 2019 1 commit
  5. 15 Feb, 2019 6 commits
  6. 13 Feb, 2019 5 commits
  7. 12 Feb, 2019 8 commits
  8. 11 Feb, 2019 5 commits
    • Robert Griesemer's avatar
      go/types: permit signed integer shift count · 6fa13365
      Robert Griesemer authored
      Permit shifts by non-constant signed integer shift counts.
      Share logic for constant shift counts in non-constant
      shifts and improve error messages a little bit.
      
      R=Go1.13
      
      Updates #19113.
      
      Change-Id: Ia01d83ca8aa60a6a3f4c49f026e0c46396f852be
      Reviewed-on: https://go-review.googlesource.com/c/159317
      Run-TryBot: Robert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAlan Donovan <adonovan@google.com>
      6fa13365
    • Robert Griesemer's avatar
      text/scanner: accept new Go2 number literals · 710417bc
      Robert Griesemer authored
      This CL introduces text/scanner support for the new binary and octal integer
      literals, hexadecimal floats, and digit separators for all number literals.
      The new code is closely mirroring the respective code for number literals in
      cmd/compile/internal/syntax/scanner.go.
      
      Uniformly use the term "invalid" rather than "illegal" in error messages
      to match the respective error messages in the other scanners directly.
      
      R=Go1.13
      
      Updates #12711.
      Updates #19308.
      Updates #28493.
      Updates #29008.
      
      Change-Id: I2f291de13ba5afc0e530cd8326e6bf4c3858ebac
      Reviewed-on: https://go-review.googlesource.com/c/161199
      Run-TryBot: Robert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      710417bc
    • Robert Griesemer's avatar
      cmd/compile: do not export float or complex constants with -asmhdr · 33ac8544
      Robert Griesemer authored
      The -asmhdr flag is used to generate header files for assembly code
      such that that code has access to compile-time constants. During
      the build these constants end up in the (ephemeral) file go_asm.h.
      
      For historical reasons, floating-point and complex constants are
      printed with a 'p' exponent but with decimal mantissa; also, because
      of the compiler-internal precision of 512 bits, the mantissae are quite
      large (and conversions are comparatively slow).
      
      With the changes to the new Go 2 number literals, the respective
      upcoming changes to text/scanner (which in turn is used by the assembler)
      will make text/scanner newly accept hexadecimal floats; but also decimal
      floats using the incorrect 'p' exponent and report an error in that case.
      
      As a consequence, the assembler will report an error when trying to parse
      the before-mentioned decimal floating-point values which are using 'p'
      exponents. Since these constants are never needed in the assembly code,
      do not emit them in the first place.
      
      Change-Id: I06c7c96b04e8d062441120107992472f87a651b2
      Reviewed-on: https://go-review.googlesource.com/c/161904
      Run-TryBot: Robert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      33ac8544
    • Robert Griesemer's avatar
      text/scanner: don't crash when calling TokenText in error handler · 85c1798a
      Robert Griesemer authored
      Make sure Scanner.tokEnd is set before we call Scanner.Error
      and update documentation accordingly.
      (Until now tokEnd was only set before returning from Scan,
      so a call to TokenText during error handling may have crashed.)
      
      While at it, tighten a check in Scanner.TokenText to ensure
      Scanner.tokEnd >= Scanner.tokPos if we have a token.
      
      Also, silence error messages to Stderr in unrelated TestIllegalExponent.
      
      Fixes #29723.
      
      Change-Id: Ia97beeae91eaf9e0ed3dada0a806f1f7122461cc
      Reviewed-on: https://go-review.googlesource.com/c/157819Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      85c1798a
    • Robert Griesemer's avatar
      cmd/gofmt: normalize number prefixes and exponents · 69de40c9
      Robert Griesemer authored
      Rewrite non-decimal number prefixes to always use a lower-case base
      ("0X" -> "0x", etc.), and rewrite exponents to use a lower-case 'e'
      or 'p'. Leave hexadecimal digits and 0-octals alone.
      
      Comparing the best time of 3 runs of `time go test -run All` with
      the time for a gofmt that doesn't do the rewrite shows no increase
      in runtime for this bulk gofmt application (in fact on my machine
      I see a small decline, probably due to cache effects).
      
      R=Go1.13
      
      Updates #12711.
      Updates #19308.
      Updates #29008.
      
      Change-Id: I9c6ebed2ffa0a6a001c59412a73382090955f5a9
      Reviewed-on: https://go-review.googlesource.com/c/160184Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      69de40c9