mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
ast: add str for comment (#8019)
This commit is contained in:
parent
fdf5f5003b
commit
c8bcee9639
@ -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'
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user