ast: add case for ConstDecl in `fn (node Stmt) str()` (#8073)
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