1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

v2: parse builtin.v, cfns.v float.v

This commit is contained in:
Alexander Medvednikov
2020-02-04 09:54:15 +01:00
parent 432ee93916
commit 83f0c228e9
11 changed files with 122 additions and 44 deletions

View File

@@ -92,6 +92,11 @@ pub const (
name: 'bool'
idx: bool_type_idx
}
byte_type = Type{
kind: .byte
name: 'byte'
idx: byte_type_idx
}
)
/*
pub fn (t Type) str() string {

View File

@@ -251,6 +251,13 @@ pub fn (t mut Table) register_type(typ Type) int {
return idx
}
pub fn (t &Table) known_type(name string) bool {
_ = t.find_type(name) or {
return false
}
return true
}
pub fn (t mut Table) find_or_register_map(key_typ &Type, value_typ &Type) (int,string) {
name := 'map_${key_typ.name}_${value_typ.name}'
// existing