1
0
mirror of https://github.com/golang/go synced 2024-11-21 18:04:40 -07:00

go spec: clean up use of QualifiedIdent production.

Fixes #3763.

R=r, rsc, iant, ken
CC=golang-dev
https://golang.org/cl/6333066
This commit is contained in:
Robert Griesemer 2012-06-26 11:49:19 -07:00
parent 596762e9a1
commit 809e06babc

View File

@ -1,6 +1,6 @@
<!--{ <!--{
"Title": "The Go Programming Language Specification", "Title": "The Go Programming Language Specification",
"Subtitle": "Version of June 22, 2012", "Subtitle": "Version of June 26, 2012",
"Path": "/ref/spec" "Path": "/ref/spec"
}--> }-->
@ -622,14 +622,15 @@ expressions</a>.
<p> <p>
A type determines the set of values and operations specific to values of that A type determines the set of values and operations specific to values of that
type. A type may be specified by a (possibly qualified) <i>type name</i> type. A type may be specified by a
<a href="#Qualified_identifiers">Qualified identifier</a>, §<a href="#Type_declarations">Type declarations</a>) or a <i>type literal</i>, (possibly <a href="#Qualified_identifiers">qualified</a>) <i>type name</i>
<a href="#Type_declarations">Type declarations</a>) or a <i>type literal</i>,
which composes a new type from previously declared types. which composes a new type from previously declared types.
</p> </p>
<pre class="ebnf"> <pre class="ebnf">
Type = TypeName | TypeLit | "(" Type ")" . Type = TypeName | TypeLit | "(" Type ")" .
TypeName = QualifiedIdent . TypeName = identifier | QualifiedIdent .
TypeLit = ArrayType | StructType | PointerType | FunctionType | InterfaceType | TypeLit = ArrayType | StructType | PointerType | FunctionType | InterfaceType |
SliceType | MapType | ChannelType . SliceType | MapType | ChannelType .
</pre> </pre>
@ -2026,25 +2027,33 @@ operators and functions to operands.
<h3 id="Operands">Operands</h3> <h3 id="Operands">Operands</h3>
<p> <p>
Operands denote the elementary values in an expression. Operands denote the elementary values in an expression. An operand may be a
literal, a (possibly <a href="#Qualified_identifiers">qualified</a>) identifier
denoting a
<a href="#Constant_declarations">constant</a>,
<a href="#Variable_declarations">variable</a>, or
<a href="#Function_declarations">function</a>,
a <a href="#Method_expressions">method expression</a> yielding a function,
or a parenthesized expression.
</p> </p>
<pre class="ebnf"> <pre class="ebnf">
Operand = Literal | QualifiedIdent | MethodExpr | "(" Expression ")" . Operand = Literal | OperandName | MethodExpr | "(" Expression ")" .
Literal = BasicLit | CompositeLit | FunctionLit . Literal = BasicLit | CompositeLit | FunctionLit .
BasicLit = int_lit | float_lit | imaginary_lit | char_lit | string_lit . BasicLit = int_lit | float_lit | imaginary_lit | char_lit | string_lit .
OperandName = identifier | QualifiedIdent.
</pre> </pre>
<h3 id="Qualified_identifiers">Qualified identifiers</h3> <h3 id="Qualified_identifiers">Qualified identifiers</h3>
<p> <p>
A qualified identifier is a non-<a href="#Blank_identifier">blank</a> identifier A qualified identifier is an identifier qualified with a package name prefix.
qualified by a package name prefix. Both the package name and the identifier must not be
<a href="#Blank_identifier">blank</a>.
</p> </p>
<pre class="ebnf"> <pre class="ebnf">
QualifiedIdent = [ PackageName "." ] identifier . QualifiedIdent = PackageName "." identifier .
</pre> </pre>
<p> <p>