Fix unicode handling and add tests
We now also return an incomplete triple to aid in debugging - non-nil error means that this is not usable except for manual examination.
This commit is contained in:
parent
59e3d620a5
commit
dc17ccae80
5 changed files with 79 additions and 10 deletions
|
|
@ -30,12 +30,10 @@ var (
|
|||
ErrUnterminated = errors.New("nqauds: unterminated quad")
|
||||
)
|
||||
|
||||
// Parse returns a valid graph.Triple or a non-nil error.
|
||||
func Parse(str string) (*graph.Triple, error) {
|
||||
t, err := parse([]rune(str))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &t, nil
|
||||
return &t, err
|
||||
}
|
||||
|
||||
type Decoder struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue