Ejemplo n.º 1
0
Archivo: common.go Proyecto: kpmy/lomo
func (p *common) typ(resolve lpp.ForeignResolver, t *ir.Type) {
	assert.For(p.sym.Code == lss.Ident, 20, "type identifier expected here but found ", p.sym.Code)
	id := p.ident()
	if it := types.TypMap[id]; it != types.UNDEF {
		t.Basic = true
		t.Builtin = &ir.BuiltinType{Code: it}
	} else if ft := resolve(id); ft != nil { //append import resolver
		t.Basic = false
		t.Foreign = ft
	} else {
		p.mark("undefined type ", id)
	}
	p.next()
}