doc/ref: remove dot import
An eye sore and with upcoming embedding
not that useful anymore
Change-Id: If76c2f4dfa8b5f829a08be1c6dde4d3cbe6eb89c
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/2840
Reviewed-by: Jonathan Amsterdam <jba@google.com>
diff --git a/cue/parser/parser.go b/cue/parser/parser.go
index 2268450..045b026 100644
--- a/cue/parser/parser.go
+++ b/cue/parser/parser.go
@@ -1242,11 +1242,7 @@
c := p.openComments()
var ident *ast.Ident
- switch p.tok {
- case token.PERIOD:
- ident = &ast.Ident{NamePos: p.pos, Name: "."}
- p.next()
- case token.IDENT:
+ if p.tok == token.IDENT {
ident = p.parseIdent()
}
diff --git a/cue/parser/parser_test.go b/cue/parser/parser_test.go
index 89973a5..22f5728 100644
--- a/cue/parser/parser_test.go
+++ b/cue/parser/parser_test.go
@@ -101,19 +101,17 @@
import (
a "foo"
"bar/baz"
- . "model"
)
`,
- `package k8s, import ( a "foo", "bar/baz", . "model" )`,
+ `package k8s, import ( a "foo", "bar/baz" )`,
}, {
"imports single",
`package k8s
import a "foo"
import "bar/baz"
- import . "model"
`,
- `package k8s, import a "foo", import "bar/baz", import . "model"`,
+ `package k8s, import a "foo", import "bar/baz"`,
}, {
"collapsed fields",
`a b c: 1
diff --git a/cue/parser/testdata/commas.src b/cue/parser/testdata/commas.src
index b159a0d..0a75770 100644
--- a/cue/parser/testdata/commas.src
+++ b/cue/parser/testdata/commas.src
@@ -18,7 +18,7 @@
import "path/to/pkg"
import name "path/to/pkg"
-import . "path/to/pkg"
+import . /* ERROR "expected 'STRING', found '.' " */
import /* ERROR "expected 'STRING', found newline" */
import err /* ERROR "expected 'STRING', found newline" */
diff --git a/doc/ref/spec.md b/doc/ref/spec.md
index 84ae5db..c6e01ca 100644
--- a/doc/ref/spec.md
+++ b/doc/ref/spec.md
@@ -2534,7 +2534,7 @@
```
ImportDecl = "import" ( ImportSpec | "(" { ImportSpec ";" } ")" ) .
-ImportSpec = [ "." | PackageName ] ImportPath .
+ImportSpec = [ PackageName ] ImportPath .
ImportPath = `"` { unicode_value } `"` .
```
@@ -2543,12 +2543,6 @@
It is declared in the file block.
If the PackageName is omitted, it defaults to the identifier specified in the
package clause of the imported instance.
-If an explicit period (.) appears instead of a name, all the instances's
-exported identifiers declared in that instances's package block will be declared
-in the importing source file's file block
-and must be accessed without a qualifier.
-<!-- jba: Can you omit this feature? It's likely to only decrease readability,
-as we know from Go. -->
The interpretation of the ImportPath is implementation-dependent but it is
typically either the path of a builtin package or a fully qualifying location
@@ -2570,7 +2564,6 @@
import "lib/math" math.Sin
import m "lib/math" m.Sin
-import . "lib/math" Sin
```
An import declaration declares a dependency relation between the importing and