From b5a8dcb0d2e8e2a58f0fdd9743eae9b3a2b39786 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Thu, 20 Jun 2019 16:50:48 -0700 Subject: [PATCH] doc/go1.13: document changes to gofmt, go/* libs, and fix entry for text/scanner Change-Id: I2230a97c681406f248b7f2fff45dd80a4b54a4b3 Reviewed-on: https://go-review.googlesource.com/c/go/+/183357 Reviewed-by: Ian Lance Taylor --- doc/go1.13.html | 55 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 7 deletions(-) diff --git a/doc/go1.13.html b/doc/go1.13.html index 5655b06d6c..e2099ce2d6 100644 --- a/doc/go1.13.html +++ b/doc/go1.13.html @@ -91,9 +91,9 @@ TODO

These language changes were implemented by changes to the compiler, and corresponding internal changes to the library - packages go/scanner and - text/scanner (number literals), - and go/types (signed shift counts). + packages go/scanner and + text/scanner (number literals), + and go/types (signed shift counts).

@@ -191,6 +191,22 @@ TODO introduced in ARM v8.1.

+

gofmt

+ +

+ gofmt (and with that go fmt) now canonicalizes + number literal prefixes and exponents to use lower-case letters, but + leaves hexadecimal digits alone. This improves readability when using the new octal prefix + (0O becomes 0o), and the rewrite is applied consistently. + gofmt now also removes unnecessary leading zeroes from a decimal integer + imaginary literal. (For backwards-compatibility, an integer imaginary literal + starting with 0 is considered a decimal, not an octal number. + Removing superfluous leading zeroes avoids potential confusion.) + For instance, 0B1010, 0XabcDEF, 0O660, + 1.2E3, and 01i become 0b1010, 0xabcDEF, + 0o660, 1.2e3, and 1i after applying gofmt. +

+

Runtime

@@ -338,7 +354,28 @@ TODO type attribute, code will now be interperted as JavaScript module script.

- + + +
go/scanner
+
+

+ The scanner has been updated to recognize the new Go number literals, specifically + binary literals with 0b/0B prefix, octal literals with 0o/0O prefix, + and floating-point numbers with hexadecimal mantissa. The imaginary suffix i may now be used with any number + literal, and underscores may used as digit separators for grouping. + See the Changes to the language for details. +

+ +
+ +
go/types
+
+

+ The type-checker has been updated to follow the new rules for integer shifts. + See the Changes to the language for details. +

+ +
log
@@ -537,9 +574,13 @@ TODO
text/scanner
-

- The new AllowNumberbars - mode allows number literals to contain underbars as digit separators. +

+ The scanner has been updated to recognize the new Go number literals, specifically + binary literals with 0b/0B prefix, octal literals with 0o/0O prefix, + and floating-point numbers with hexadecimal mantissa. + Also, the new AllowDigitSeparators + mode allows number literals to contain underscores as digit separators (off by default for backwards-compatibility). + See the Changes to the language for details.

-- 2.50.0