diff --git a/vlib/v/ast/str.v b/vlib/v/ast/str.v index e032f51834..5ad633f63c 100644 --- a/vlib/v/ast/str.v +++ b/vlib/v/ast/str.v @@ -225,6 +225,15 @@ pub fn (x Expr) str() string { CharLiteral { return '`$x.val`' } + Comment { + if x.is_multi { + lines := x.text.split_into_lines() + return '/* $lines.len lines comment */' + } else { + text := x.text.trim('\x01').trim_space() + return '// $text' + } + } ComptimeSelector { return '${x.left}.$$x.field_expr' }