diff options
author | NeonXP <i@neonxp.dev> | 2022-12-27 04:14:41 +0300 |
---|---|---|
committer | NeonXP <i@neonxp.dev> | 2022-12-27 04:14:41 +0300 |
commit | 67d30e9444c7bdae62906477cafb5f992c5b70e1 (patch) | |
tree | 0b9d9c2aa6cee5df0d50cb68a3a808714f4aed68 | |
parent | 76a7f461ebbde70ea0e3d4f9b79c08139acaee7c (diff) |
Rename to SetParentv0.1.1
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | factory.go | 2 | ||||
-rw-r--r-- | parser.go | 12 |
3 files changed, 8 insertions, 8 deletions
@@ -114,7 +114,7 @@ type NullNode interface { // Если узел имплементирует этот интерфейс то вызывается метод Parent передающий родительский узел type AcceptParent interface { - Parent(n Node) + SetParent(n Node) } ``` @@ -42,5 +42,5 @@ type NullNode interface { } type AcceptParent interface { - Parent(n Node) + SetParent(n Node) } @@ -21,7 +21,7 @@ func (j *JSON) createChild(parent Node, l lexer.Lexem, ch chan lexer.Lexem) (Nod return nil, err } if c, ok := c.(AcceptParent); ok { - c.Parent(parent) + c.SetParent(parent) } child := c.(StringNode) child.SetString(strings.Trim(l.Value, `"`)) @@ -36,7 +36,7 @@ func (j *JSON) createChild(parent Node, l lexer.Lexem, ch chan lexer.Lexem) (Nod return nil, err } if c, ok := c.(AcceptParent); ok { - c.Parent(parent) + c.SetParent(parent) } child := c.(NumberNode) child.SetNumber(num) @@ -48,7 +48,7 @@ func (j *JSON) createChild(parent Node, l lexer.Lexem, ch chan lexer.Lexem) (Nod return nil, err } if c, ok := c.(AcceptParent); ok { - c.Parent(parent) + c.SetParent(parent) } child := c.(BooleanNode) child.SetBool(b) @@ -71,7 +71,7 @@ func (j *JSON) createChild(parent Node, l lexer.Lexem, ch chan lexer.Lexem) (Nod return nil, err } if c, ok := c.(AcceptParent); ok { - c.Parent(parent) + c.SetParent(parent) } return c.(NullNode), nil default: @@ -85,7 +85,7 @@ func (j *JSON) parseObject(parent Node, ch chan lexer.Lexem) (ObjectNode, error) return nil, err } if c, ok := c.(AcceptParent); ok { - c.Parent(parent) + c.SetParent(parent) } n := c.(ObjectNode) nextKey := "" @@ -114,7 +114,7 @@ func (j *JSON) parseArray(parent Node, ch chan lexer.Lexem) (ArrayNode, error) { return nil, err } if c, ok := c.(AcceptParent); ok { - c.Parent(parent) + c.SetParent(parent) } n := c.(ArrayNode) for l := range ch { |