From 4cc71e336300d50a50b006779207a19deb0c715e Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Thu, 3 Oct 2013 16:38:22 -0700 Subject: [PATCH] spec: added additional links, added missing 'label' No semantic spec changes. R=r CC=golang-dev https://golang.org/cl/14363043 --- doc/go_spec.html | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/doc/go_spec.html b/doc/go_spec.html index 59bf493622..e62965ab9b 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1512,8 +1512,13 @@ Blocks nest and influence scoping.

Declarations and scope

-A declaration binds a non-blank -identifier to a constant, type, variable, function, or package. +A declaration binds a non-blank identifier to a +constant, +type, +variable, +function, +label, or +package. Every identifier in a program must be declared. No identifier may be declared twice in the same block, and no identifier may be declared in both the file and package block. @@ -1526,15 +1531,15 @@ TopLevelDecl = Declaration | FunctionDecl | MethodDecl .

The scope of a declared identifier is the extent of source text in which -the identifier denotes the specified constant, type, variable, function, or package. +the identifier denotes the specified constant, type, variable, function, label, or package.

-Go is lexically scoped using blocks: +Go is lexically scoped using blocks:

    -
  1. The scope of a predeclared identifier is the universe block.
  2. +
  3. The scope of a predeclared identifier is the universe block.
  4. The scope of an identifier denoting a constant, type, variable, or function (but not method) declared at top level (outside any @@ -1589,7 +1594,7 @@ the body of any nested function.

    The blank identifier, represented by the underscore character _, may be used in a declaration like -any other identifier but the declaration does not introduce a new binding. +any other identifier but the declaration does not introduce a new binding.

    -- 2.50.0