Only top level entities are in toplevel.go
This commit is contained in:
parent
fc2fb42e53
commit
0a56a61f4f
|
@ -6,6 +6,31 @@ import "unicode"
|
||||||
import "github.com/google/uuid"
|
import "github.com/google/uuid"
|
||||||
import "git.tebibyte.media/fspl/fspl/errors"
|
import "git.tebibyte.media/fspl/fspl/errors"
|
||||||
|
|
||||||
|
// Access determines the external access control mode for a top-level entity.
|
||||||
|
type Access int; const (
|
||||||
|
// AccessPublic allows other modules to access an entity normally.
|
||||||
|
AccessPublic Access = iota
|
||||||
|
|
||||||
|
// AccessOpaque causes a top-level entity to appear opaque to other
|
||||||
|
// units. Values of opaque types can be passed around, assigned to each-
|
||||||
|
// other, and their methods can be called, but the implementation of the
|
||||||
|
// type is entirely hidden. This access mode cannot be applied to
|
||||||
|
// functions or methods.
|
||||||
|
AccessOpaque
|
||||||
|
|
||||||
|
// AccessPrivate disallows other modules from accessing a top-level
|
||||||
|
// entity.
|
||||||
|
AccessPrivate
|
||||||
|
)
|
||||||
|
func (this Access) String () string {
|
||||||
|
switch this {
|
||||||
|
case AccessPrivate: return "-"
|
||||||
|
case AccessOpaque: return "#"
|
||||||
|
case AccessPublic: return "+"
|
||||||
|
default: return fmt.Sprintf("entity.Access(%d)", this)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Signature is a function or method signature that is used in functions,
|
// Signature is a function or method signature that is used in functions,
|
||||||
// methods, and specifying interface behaviors. It defines the type of a
|
// methods, and specifying interface behaviors. It defines the type of a
|
||||||
// function.
|
// function.
|
||||||
|
|
|
@ -20,32 +20,6 @@ type TopLevel interface {
|
||||||
topLevel ()
|
topLevel ()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Access determines the external access control mode for a top-level entity.
|
|
||||||
type Access int; const (
|
|
||||||
// AccessPublic allows other modules to access an entity normally.
|
|
||||||
AccessPublic Access = iota
|
|
||||||
|
|
||||||
// AccessOpaque causes a top-level entity to appear opaque to other
|
|
||||||
// units. Values of opaque types can be passed around, assigned to each-
|
|
||||||
// other, and their methods can be called, but the implementation of the
|
|
||||||
// type is entirely hidden. This access mode cannot be applied to
|
|
||||||
// functions or methods.
|
|
||||||
AccessOpaque
|
|
||||||
|
|
||||||
// AccessPrivate disallows other modules from accessing a top-level
|
|
||||||
// entity.
|
|
||||||
AccessPrivate
|
|
||||||
)
|
|
||||||
|
|
||||||
func (this Access) String () string {
|
|
||||||
switch this {
|
|
||||||
case AccessPrivate: return "-"
|
|
||||||
case AccessOpaque: return "#"
|
|
||||||
case AccessPublic: return "+"
|
|
||||||
default: return fmt.Sprintf("entity.Access(%d)", this)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ TopLevel = &Typedef { }
|
var _ TopLevel = &Typedef { }
|
||||||
// Typedef binds a type to a global identifier.
|
// Typedef binds a type to a global identifier.
|
||||||
type Typedef struct {
|
type Typedef struct {
|
||||||
|
|
Loading…
Reference in New Issue