version 1.15, 2018/08/16 20:41:42 |
version 1.16, 2018/09/05 17:56:22 |
Line 79 func (vt *Vartype) EffectivePermissions( |
|
Line 79 func (vt *Vartype) EffectivePermissions( |
|
return aclpUnknown |
return aclpUnknown |
} |
} |
|
|
// Returns the union of all possible permissions. This can be used to |
// Union returns the union of all possible permissions. |
// check whether a variable may be defined or used at all, or if it is |
// This can be used to check whether a variable may be defined or used |
// read-only. |
// at all, or if it is read-only. |
func (vt *Vartype) Union() ACLPermissions { |
func (vt *Vartype) Union() ACLPermissions { |
var permissions ACLPermissions |
var permissions ACLPermissions |
for _, aclEntry := range vt.aclEntries { |
for _, aclEntry := range vt.aclEntries { |
Line 100 func (vt *Vartype) AllowedFiles(perms AC |
|
Line 100 func (vt *Vartype) AllowedFiles(perms AC |
|
return strings.Join(files, ", ") |
return strings.Join(files, ", ") |
} |
} |
|
|
// Returns whether the type is considered a shell list. |
// IsConsideredList returns whether the type is considered a shell list. |
// This distinction between "real lists" and "considered a list" makes |
// This distinction between "real lists" and "considered a list" makes |
// the implementation of checklineMkVartype easier. |
// the implementation of checklineMkVartype easier. |
func (vt *Vartype) IsConsideredList() bool { |
func (vt *Vartype) IsConsideredList() bool { |
Line 122 func (vt *Vartype) MayBeAppendedTo() boo |
|
Line 122 func (vt *Vartype) MayBeAppendedTo() boo |
|
} |
} |
|
|
func (vt *Vartype) String() string { |
func (vt *Vartype) String() string { |
listPrefix := "" |
listPrefix := [...]string{"", "SpaceList of ", "ShellList of "}[vt.kindOfList] |
switch vt.kindOfList { |
|
case lkNone: |
|
listPrefix = "" |
|
case lkSpace: |
|
listPrefix = "SpaceList of " |
|
case lkShell: |
|
listPrefix = "ShellList of " |
|
default: |
|
panic("Unknown list type") |
|
} |
|
|
|
guessedSuffix := ifelseStr(vt.guessed, " (guessed)", "") |
guessedSuffix := ifelseStr(vt.guessed, " (guessed)", "") |
|
|
return listPrefix + vt.basicType.name + guessedSuffix |
return listPrefix + vt.basicType.name + guessedSuffix |
} |
} |
|
|