2008-07-10 18:21:23 -06:00
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package Object
|
|
|
|
|
|
|
|
import Globals "globals"
|
|
|
|
|
|
|
|
|
2008-08-04 11:19:36 -06:00
|
|
|
export const /* kind */ (
|
2008-07-10 18:21:23 -06:00
|
|
|
BAD = iota; // error handling
|
2008-08-11 21:40:37 -06:00
|
|
|
CONST; TYPE; VAR; FIELD; FUNC; PACKAGE; LABEL;
|
2008-08-01 15:50:18 -06:00
|
|
|
END; // end of scope (import/export only)
|
2008-07-10 18:21:23 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
|
2008-07-14 17:57:42 -06:00
|
|
|
// The 'Object' declaration should be here as well, but 6g cannot handle
|
|
|
|
// this due to cross-package circular references. For now it's all in
|
|
|
|
// globals.go.
|
2008-07-30 22:26:15 -06:00
|
|
|
|
|
|
|
|
2008-08-04 16:37:47 -06:00
|
|
|
export func KindStr(kind int) string {
|
2008-07-30 22:26:15 -06:00
|
|
|
switch kind {
|
|
|
|
case BAD: return "BAD";
|
|
|
|
case CONST: return "CONST";
|
|
|
|
case TYPE: return "TYPE";
|
|
|
|
case VAR: return "VAR";
|
2008-08-11 21:40:37 -06:00
|
|
|
case FIELD: return "FIELD";
|
2008-07-30 22:26:15 -06:00
|
|
|
case FUNC: return "FUNC";
|
|
|
|
case PACKAGE: return "PACKAGE";
|
|
|
|
case LABEL: return "LABEL";
|
2008-08-01 15:50:18 -06:00
|
|
|
case END: return "END";
|
2008-07-30 22:26:15 -06:00
|
|
|
}
|
|
|
|
return "<unknown Object kind>";
|
|
|
|
}
|