@@ -187,7 +187,6 @@ func (p *parser) parseQualifiedNameStr(unquotedName string) (pkgpath, name strin
187
187
// getPkg returns the package for a given path. If the package is
188
188
// not found but we have a package name, create the package and
189
189
// add it to the p.imports map.
190
- //
191
190
func (p * parser ) getPkg (pkgpath , name string ) * types.Package {
192
191
// package unsafe is not in the imports map - handle explicitly
193
192
if pkgpath == "unsafe" {
@@ -904,6 +903,7 @@ const (
904
903
gccgoBuiltinERROR = 19
905
904
gccgoBuiltinBYTE = 20
906
905
gccgoBuiltinRUNE = 21
906
+ gccgoBuiltinANY = 22
907
907
)
908
908
909
909
func lookupBuiltinType (typ int ) types.Type {
@@ -928,13 +928,13 @@ func lookupBuiltinType(typ int) types.Type {
928
928
gccgoBuiltinERROR : types .Universe .Lookup ("error" ).Type (),
929
929
gccgoBuiltinBYTE : types .Universe .Lookup ("byte" ).Type (),
930
930
gccgoBuiltinRUNE : types .Universe .Lookup ("rune" ).Type (),
931
+ gccgoBuiltinANY : types .Universe .Lookup ("any" ).Type (),
931
932
}[typ ]
932
933
}
933
934
934
935
// Type = "<" "type" ( "-" int | int [ TypeSpec ] ) ">" .
935
936
//
936
937
// parseType updates the type map to t for all type numbers n.
937
- //
938
938
func (p * parser ) parseType (pkg * types.Package , n ... any ) types.Type {
939
939
p .expect ('<' )
940
940
t , _ := p .parseTypeAfterAngle (pkg , n ... )
@@ -1117,9 +1117,10 @@ func (p *parser) maybeCreatePackage() {
1117
1117
}
1118
1118
1119
1119
// InitDataDirective = ( "v1" | "v2" | "v3" ) ";" |
1120
- // "priority" int ";" |
1121
- // "init" { PackageInit } ";" |
1122
- // "checksum" unquotedString ";" .
1120
+ //
1121
+ // "priority" int ";" |
1122
+ // "init" { PackageInit } ";" |
1123
+ // "checksum" unquotedString ";" .
1123
1124
func (p * parser ) parseInitDataDirective () {
1124
1125
if p .tok != scanner .Ident {
1125
1126
// unexpected token kind; panic
@@ -1170,15 +1171,16 @@ func (p *parser) parseInitDataDirective() {
1170
1171
}
1171
1172
1172
1173
// Directive = InitDataDirective |
1173
- // "package" unquotedString [ unquotedString ] [ unquotedString ] ";" |
1174
- // "pkgpath" unquotedString ";" |
1175
- // "prefix" unquotedString ";" |
1176
- // "import" unquotedString unquotedString string ";" |
1177
- // "indirectimport" unquotedString unquotedstring ";" |
1178
- // "func" Func ";" |
1179
- // "type" Type ";" |
1180
- // "var" Var ";" |
1181
- // "const" Const ";" .
1174
+ //
1175
+ // "package" unquotedString [ unquotedString ] [ unquotedString ] ";" |
1176
+ // "pkgpath" unquotedString ";" |
1177
+ // "prefix" unquotedString ";" |
1178
+ // "import" unquotedString unquotedString string ";" |
1179
+ // "indirectimport" unquotedString unquotedstring ";" |
1180
+ // "func" Func ";" |
1181
+ // "type" Type ";" |
1182
+ // "var" Var ";" |
1183
+ // "const" Const ";" .
1182
1184
func (p * parser ) parseDirective () {
1183
1185
if p .tok != scanner .Ident {
1184
1186
// unexpected token kind; panic
0 commit comments