From 94ad175728659bdfa1f03765873bc8d62fd470e0 Mon Sep 17 00:00:00 2001 From: Thomas Pelletier Date: Tue, 2 Feb 2021 10:55:23 -0500 Subject: [PATCH] wip --- encoding.go | 75 ++++++++++++++++++++++++++++++++++++++++++++++-- encoding_test.go | 1 + 2 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 encoding_test.go diff --git a/encoding.go b/encoding.go index 5b9b969..510a7a1 100644 --- a/encoding.go +++ b/encoding.go @@ -1,8 +1,79 @@ package toml +type unmarshaler struct { +} + +func (u unmarshaler) Whitespace(b []byte) {} +func (u unmarshaler) Comment(b []byte) {} + +func (u unmarshaler) UnquotedKey(b []byte) { + panic("implement me") +} + +func (u unmarshaler) LiteralString(b []byte) { + panic("implement me") +} + +func (u unmarshaler) BasicString(b []byte) { + panic("implement me") +} + +func (u unmarshaler) Dot(b []byte) { + panic("implement me") +} + +func (u unmarshaler) Boolean(b []byte) { + panic("implement me") +} + +func (u unmarshaler) Equal(b []byte) { + panic("implement me") +} + +func (u unmarshaler) ArrayBegin() { + panic("implement me") +} + +func (u unmarshaler) ArrayEnd() { + panic("implement me") +} + +func (u unmarshaler) ArraySeparator() { + panic("implement me") +} + +func (u unmarshaler) InlineTableBegin() { + panic("implement me") +} + +func (u unmarshaler) InlineTableEnd() { + panic("implement me") +} + +func (u unmarshaler) InlineTableSeparator() { + panic("implement me") +} + +func (u unmarshaler) StandardTableBegin() { + panic("implement me") +} + +func (u unmarshaler) StandardTableEnd() { + panic("implement me") +} + +func (u unmarshaler) ArrayTableBegin() { + panic("implement me") +} + +func (u unmarshaler) ArrayTableEnd() { + panic("implement me") +} + func Unmarshal(data []byte, v interface{}) error { - // TODO - return nil + p := unmarshaler{} + l := lexer{parser: &p, data: data} + return l.run() } func Marshal(v interface{}) ([]byte, error) { diff --git a/encoding_test.go b/encoding_test.go new file mode 100644 index 0000000..27aae5a --- /dev/null +++ b/encoding_test.go @@ -0,0 +1 @@ +package toml_test