stmt/class: support extends (single inheritance) by struct embedding
This commit is contained in:
parent
67932cd296
commit
5344bbe078
9
node.go
9
node.go
@ -107,6 +107,15 @@ func convert(n_ node.Node) (string, error) {
|
|||||||
memberVars := []string{}
|
memberVars := []string{}
|
||||||
memberFuncs := []string{}
|
memberFuncs := []string{}
|
||||||
|
|
||||||
|
if n.Extends != nil {
|
||||||
|
parentName, err := resolveName(n.Extends.ClassName)
|
||||||
|
if err != nil {
|
||||||
|
return "", parseErr{n, err}
|
||||||
|
}
|
||||||
|
|
||||||
|
memberVars = append(memberVars, parentName+" // parent")
|
||||||
|
}
|
||||||
|
|
||||||
// Walk all child nodes of the class
|
// Walk all child nodes of the class
|
||||||
for _, s_ := range n.Stmts {
|
for _, s_ := range n.Stmts {
|
||||||
switch s := s_.(type) {
|
switch s := s_.(type) {
|
||||||
|
Loading…
Reference in New Issue
Block a user