mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
ast: add case for ConstDecl in fn (node Stmt) str()
(#8073)
This commit is contained in:
parent
245ed9160a
commit
4923048d95
@ -338,6 +338,12 @@ pub fn (node Stmt) str() string {
|
||||
BranchStmt {
|
||||
return node.str()
|
||||
}
|
||||
ConstDecl {
|
||||
fields := node.fields.map(fn (f ConstField) string {
|
||||
return '${f.name.trim_prefix(f.mod + '.')} = $f.expr'
|
||||
})
|
||||
return 'const (${fields.join(' ')})'
|
||||
}
|
||||
ExprStmt {
|
||||
return node.expr.str()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user