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

ast: add case for Import in fn (node Stmt) str()

This commit is contained in:
zakuro 2021-01-13 22:56:48 +09:00 committed by GitHub
parent 4923048d95
commit 204cc5fb01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -356,6 +356,13 @@ pub fn (node Stmt) str() string {
Module { Module {
return 'module $node.name' return 'module $node.name'
} }
Import {
mut out := 'import $node.mod'
if node.alias.len > 0 {
out += ' as $node.alias'
}
return out
}
StructDecl { StructDecl {
return 'struct $node.name { $node.fields.len fields }' return 'struct $node.name { $node.fields.len fields }'
} }