mirror of
https://github.com/golang/go
synced 2024-11-21 19:24:45 -07:00
- completed syntax for import declarations
- fixed a typo SVN=117439
This commit is contained in:
parent
38c083c1ca
commit
1975ff8b44
@ -1512,7 +1512,7 @@ Switch statements
|
||||
|
||||
Switches provide multi-way execution.
|
||||
|
||||
SwitchStat = "switch" [ [ SimpleStat ";" ] "Expression ] "{" { CaseClause } "}" .
|
||||
SwitchStat = "switch" [ [ SimpleStat ";" ] Expression ] "{" { CaseClause } "}" .
|
||||
CaseClause = CaseList StatementList [ ";" ] [ "fallthrough" [ ";" ] ] .
|
||||
CaseList = Case { Case } .
|
||||
Case = ( "case" ExpressionList | "default" ) ":" .
|
||||
@ -1686,6 +1686,7 @@ array elements (the values).
|
||||
|
||||
TODO: is this right?
|
||||
|
||||
|
||||
Break statements
|
||||
----
|
||||
|
||||
@ -1762,8 +1763,9 @@ Import declarations
|
||||
A program can gain access to exported items from another package
|
||||
through an import declaration:
|
||||
|
||||
ImportDecl = "import" [ "." | PackageName ] PackageFileName .
|
||||
PackageFileName = string_lit .
|
||||
ImportDecl = "import" ( ImportSpec | "(" ImportSpecList [ ";" ] ")" ) .
|
||||
ImportSpec = [ "." | PackageName ] PackageFileName .
|
||||
ImportSpecList = ImportSpec { ";" ImportSpec } .
|
||||
|
||||
An import statement makes the exported contents of the named
|
||||
package file accessible in this package.
|
||||
|
Loading…
Reference in New Issue
Block a user