mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: Infinite multi-dimensional array
This commit is contained in:
committed by
Alexander Medvednikov
parent
5faa7e7861
commit
5481f226dd
@@ -273,7 +273,10 @@ fn (p mut Parser) gen_array_str(typ Type) {
|
||||
})
|
||||
elm_type := typ.name.right(6)
|
||||
elm_type2 := p.table.find_type(elm_type)
|
||||
if p.typ_to_fmt(elm_type, 0) == '' &&
|
||||
is_array := elm_type.starts_with('array_')
|
||||
if is_array {
|
||||
p.gen_array_str(elm_type2)
|
||||
} else if p.typ_to_fmt(elm_type, 0) == '' &&
|
||||
!p.table.type_has_method(elm_type2, 'str') {
|
||||
p.error('cant print ${elm_type}[], unhandled print of ${elm_type}')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user