internal/core/export: avoid panic on non-regular identifiers for packages
The logic assumed that package identifiers are all regular
strings, but that's not necessarily the case.
The specification does explicitly disallow definition identifiers
for package names, but does not disallow "private"
identifiers.
We should probably make a subsequent change to error
when the identifier is a definition, but as that might
have more wide-ranging effects, we'll do that in
another CL.
Fixes #3968
Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I46cfb3777d434e0d18041ea42bcd28ec4d404e06
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1216862
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>