The heart of TOML is the line key = value. Today you read one such line, split it at the equals sign, and store the pair in the table, using a plain decimal integer as the first value type so the whole pipeline works end to end.
Parse a single key = value line with a decimal integer into a one-entry table.
A TOML key/value pair is written key = value, one per line. Parsing it is two
moves: split the line at the first =, then make sense of each side. The left side
is the key and the right side is the value. Whitespace around the = and
around each side is insignificant, so trim it before you look at either part.
For the value you need something concrete to store, so start with the simplest type
TOML offers: a decimal integer. Read the trimmed right-hand text as a base-10
number and wrap it in a Value of KindInteger. This gives the library its first
real round trip - text in, a typed value out - and establishes the parseValue
step that every later value form plugs into. The key today is a plain bare key;
its full character rules and quoted forms come in the next lessons.
// for each non-blank line:// split once on the first '=' into keyText and valueText// key := trimSpace(keyText) // a bare key for now// value := parseValue(trimSpace(valueText))// append Entry{key, value} to the table// parseValue today: strconv.ParseInt(text, 10, 64) -> KindInteger