package parser import "github.com/mmakaay/toml/parsekit" func stateEndOfFile(p *parsekit.P) parsekit.StateFn { if p.AtEndOfFile() { p.Emit(parsekit.ItemEOF, "EOF") // todo Automate within parser? } else { p.UnexpectedInput("end of file") } return nil }