From fc41691e4aa9cc0d2a7d11062e1132c2c746e28e Mon Sep 17 00:00:00 2001 From: mappu Date: Wed, 8 Apr 2020 20:33:37 +1200 Subject: [PATCH] node: rename ret variable --- node.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/node.go b/node.go index 5575ac4..cd19832 100644 --- a/node.go +++ b/node.go @@ -1284,9 +1284,9 @@ func removeParens(expr string) string { func (this *conversionState) resolveName(n node.Node) (string, error) { // TODO support namespace lookups - paramType := unknownVarType + ret := unknownVarType if n == nil || n == node.Node(nil) { - return paramType, nil + return ret, nil } switch n := n.(type) { @@ -1294,26 +1294,26 @@ func (this *conversionState) resolveName(n node.Node) (string, error) { if len(n.Parts) != 1 { return "", parseErr{n, fmt.Errorf("name has %d parts, expected 1", len(n.Parts))} } - paramType = n.Parts[0].(*name.NamePart).Value + ret = n.Parts[0].(*name.NamePart).Value case *name.Name: if len(n.Parts) != 1 { return "", parseErr{n, fmt.Errorf("name has %d parts, expected 1", len(n.Parts))} } - paramType = n.Parts[0].(*name.NamePart).Value + ret = n.Parts[0].(*name.NamePart).Value default: return "", fmt.Errorf("unexpected name type %#v", n) } // Handle class lookups - if strings.ToLower(paramType) == "parent" { + if strings.ToLower(ret) == "parent" { if this.currentClassParentName == "" { return "", parseErr{n, fmt.Errorf("Lookup of 'parent' while not in an inherited child class context")} } return `this.` + this.currentClassParentName, nil - } else if strings.ToLower(paramType) == "self" { + } else if strings.ToLower(ret) == "self" { // Let it through as-is // return "", parseErr{n, fmt.Errorf("Lookup of 'self::' should have been resolved already")} /* @@ -1322,12 +1322,12 @@ func (this *conversionState) resolveName(n node.Node) (string, error) { } return `this`, nil */ - } else if strings.ToLower(paramType) == "static" { + } else if strings.ToLower(ret) == "static" { return "", parseErr{n, fmt.Errorf("'static::' is not yet supported")} } - return paramType, nil + return ret, nil } func (this *conversionState) convertAssignment(n *assign.Assign, isTopLevelStatement bool) (string, error) {