Skip to content

Commit

Permalink
Calling NewNode() and NewType() instead of Node() and Type()
Browse files Browse the repository at this point in the history
  • Loading branch information
apr94 committed May 23, 2017
1 parent 13f891a commit f169139
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions triple/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,12 @@ func Parse(s string) (*Node, error) {
}
return NewNode(t, id), nil
case underscore:
id := ID(raw[2:len(raw)])
t := Type("/_")
return NewNode(&t, &id), nil
id, err := NewID(raw[2:len(raw)])
if err != nil {
return nil, fmt.Errorf("node.Parser: invalid ID in %q, %v", raw, err)
}
t, _ := NewType("/_")
return NewNode(t, id), nil
default:
return nil, fmt.Errorf("node.Parser: node representation should start with '/' or '_' in %v", raw)
}
Expand Down

0 comments on commit f169139

Please sign in to comment.