aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--factory.go2
-rw-r--r--parser.go12
3 files changed, 8 insertions, 8 deletions
diff --git a/README.md b/README.md
index a95038f..14995b6 100644
--- a/README.md
+++ b/README.md
@@ -114,7 +114,7 @@ type NullNode interface {
// Если узел имплементирует этот интерфейс то вызывается метод Parent передающий родительский узел
type AcceptParent interface {
- Parent(n Node)
+ SetParent(n Node)
}
```
diff --git a/factory.go b/factory.go
index 285c235..bf44525 100644
--- a/factory.go
+++ b/factory.go
@@ -42,5 +42,5 @@ type NullNode interface {
}
type AcceptParent interface {
- Parent(n Node)
+ SetParent(n Node)
}
diff --git a/parser.go b/parser.go
index a82960b..4e006eb 100644
--- a/parser.go
+++ b/parser.go
@@ -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 {