ast: add str for StructDecl (#7934)

pull/7952/head
zakuro 2021-01-08 04:25:04 +09:00 committed by GitHub
parent ad79d55a5c
commit af1d28dee7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -348,6 +348,9 @@ pub fn (node Stmt) str() string {
FnDecl {
return 'fn ${node.name}() { $node.stmts.len stmts }'
}
StructDecl {
return 'struct $node.name { $node.fields.len fields }'
}
else {
return '[unhandled stmt str type: ${typeof(node)} ]'
}