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

all: use the new types with old syntax (#6922)

This commit is contained in:
Daniel Däschle
2020-11-24 13:58:29 +01:00
committed by GitHub
parent 8be9bdacd1
commit aa6303f0b2
22 changed files with 303 additions and 300 deletions

View File

@ -77,7 +77,7 @@ fn (mut d Doc) convert_pos(filename string, pos token.Position) DocPos {
}
pub fn (mut d Doc) stmt_signature(stmt ast.Stmt) string {
match stmt {
match union stmt {
ast.Module {
return 'module $stmt.name'
}
@ -93,9 +93,9 @@ pub fn (mut d Doc) stmt_signature(stmt ast.Stmt) string {
}
pub fn (d Doc) stmt_name(stmt ast.Stmt) string {
match stmt {
match union stmt {
ast.FnDecl, ast.StructDecl, ast.EnumDecl, ast.InterfaceDecl { return stmt.name }
ast.TypeDecl { match stmt {
ast.TypeDecl { match union stmt {
ast.SumTypeDecl, ast.FnTypeDecl, ast.AliasTypeDecl, ast.UnionSumTypeDecl { return stmt.name }
} }
ast.ConstDecl { return '' } // leave it blank