(typeText, valText string)
| 613 | } |
| 614 | |
| 615 | func ParsePrimitive(typeText, valText string) (super.Value, error) { |
| 616 | typ := super.LookupPrimitive(typeText) |
| 617 | if typ == nil { |
| 618 | return super.Null, fmt.Errorf("no such type: %s", typeText) |
| 619 | } |
| 620 | var b scode.Builder |
| 621 | if err := BuildPrimitive(&b, Primitive{Type: typ, Text: valText}); err != nil { |
| 622 | return super.Null, err |
| 623 | } |
| 624 | it := b.Bytes().Iter() |
| 625 | return super.NewValue(typ, it.Next()), nil |
| 626 | } |
no test coverage detected