コード例 #1
0
ファイル: parse.go プロジェクト: willhite/noms-old
func indexOf(t *types.Type, ts []*types.Type) int16 {
	for i, tt := range ts {
		if tt.Name() == t.Name() {
			return int16(i)
		}
	}
	return -1
}
コード例 #2
0
func isUnionOfRefOfCommitType(t *types.Type) bool {
	if t.Kind() != types.UnionKind {
		return false
	}
	for _, et := range t.Desc.(types.CompoundDesc).ElemTypes {
		if !isRefOfCommitType(et) {
			return false
		}
	}
	return true
}
コード例 #3
0
ファイル: commit.go プロジェクト: Richardphp/noms
func fieldTypeFromCommit(t *types.Type, fieldName string) *types.Type {
	d.Chk.True(t.Kind() == types.StructKind && t.Desc.(types.StructDesc).Name == "Commit")
	return t.Desc.(types.StructDesc).Field(fieldName)
}
コード例 #4
0
ファイル: commit.go プロジェクト: Richardphp/noms
func isRefOfCommitType(t *types.Type) bool {
	return t.Kind() == types.RefKind && IsCommitType(getRefElementType(t))
}
コード例 #5
0
ファイル: commit.go プロジェクト: Richardphp/noms
func getRefElementType(t *types.Type) *types.Type {
	d.Chk.True(t.Kind() == types.RefKind)
	return t.Desc.(types.CompoundDesc).ElemTypes[0]
}