Commit 1975ff8b authored by Robert Griesemer's avatar Robert Griesemer

- completed syntax for import declarations

- fixed a typo

SVN=117439
parent 38c083c1
...@@ -1512,7 +1512,7 @@ Switch statements ...@@ -1512,7 +1512,7 @@ Switch statements
Switches provide multi-way execution. Switches provide multi-way execution.
SwitchStat = "switch" [ [ SimpleStat ";" ] "Expression ] "{" { CaseClause } "}" . SwitchStat = "switch" [ [ SimpleStat ";" ] Expression ] "{" { CaseClause } "}" .
CaseClause = CaseList StatementList [ ";" ] [ "fallthrough" [ ";" ] ] . CaseClause = CaseList StatementList [ ";" ] [ "fallthrough" [ ";" ] ] .
CaseList = Case { Case } . CaseList = Case { Case } .
Case = ( "case" ExpressionList | "default" ) ":" . Case = ( "case" ExpressionList | "default" ) ":" .
...@@ -1686,6 +1686,7 @@ array elements (the values). ...@@ -1686,6 +1686,7 @@ array elements (the values).
TODO: is this right? TODO: is this right?
Break statements Break statements
---- ----
...@@ -1762,8 +1763,9 @@ Import declarations ...@@ -1762,8 +1763,9 @@ Import declarations
A program can gain access to exported items from another package A program can gain access to exported items from another package
through an import declaration: through an import declaration:
ImportDecl = "import" [ "." | PackageName ] PackageFileName . ImportDecl = "import" ( ImportSpec | "(" ImportSpecList [ ";" ] ")" ) .
PackageFileName = string_lit . ImportSpec = [ "." | PackageName ] PackageFileName .
ImportSpecList = ImportSpec { ";" ImportSpec } .
An import statement makes the exported contents of the named An import statement makes the exported contents of the named
package file accessible in this package. package file accessible in this package.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment