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

v2: time - prefix C struct & ast.TypeName to ast.Type

This commit is contained in:
Joe Conigliaro
2020-03-04 01:06:21 +11:00
parent 448ed41562
commit 147ecc5e17
4 changed files with 11 additions and 16 deletions

View File

@@ -583,9 +583,7 @@ pub fn (p mut Parser) name_expr() ast.Expr {
// `map[string]int` initialization
if p.tok.lit == 'map' && p.peek_tok.kind == .lsbr {
map_type := p.parse_map_type()
map_type_sym := p.table.get_type_symbol(map_type)
return ast.TypeName{
name: map_type_sym.name
return ast.Type{
typ: map_type
}
}
@@ -1746,9 +1744,7 @@ fn (p mut Parser) match_expr() ast.Expr {
// if sym.kind == .sum_type {
// p.warn('is sum')
typ := p.parse_type()
typ_sym := p.table.get_type_symbol(typ)
match_exprs << ast.TypeName{
name: typ_sym.name
match_exprs << ast.Type{
typ: typ
}
p.scope.register_var(ast.VarDecl{