From 204cc5fb01bc191d067a2d45768ec8fc7de96c74 Mon Sep 17 00:00:00 2001 From: zakuro Date: Wed, 13 Jan 2021 22:56:48 +0900 Subject: [PATCH] ast: add case for Import in `fn (node Stmt) str()` --- vlib/v/ast/str.v | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vlib/v/ast/str.v b/vlib/v/ast/str.v index 005880bb30..59a879c613 100644 --- a/vlib/v/ast/str.v +++ b/vlib/v/ast/str.v @@ -356,6 +356,13 @@ pub fn (node Stmt) str() string { Module { return 'module $node.name' } + Import { + mut out := 'import $node.mod' + if node.alias.len > 0 { + out += ' as $node.alias' + } + return out + } StructDecl { return 'struct $node.name { $node.fields.len fields }' }