Strings are where JSON stops being pure punctuation and starts carrying data. Today you scan a quoted string with no escapes into a token that holds its decoded text.
Scan a double-quoted run of plain characters into a String token carrying its contents.
A JSON string is a run of characters wrapped in double quotes. The opening
quote tells the scanner “a string starts here”; it then reads forward until the
closing quote, and the bytes in between are the string’s value. The quotes
themselves are delimiters, not part of the value, so "abc" carries abc and ""
carries the empty string.
Today deliberately handles only the simple case: no backslash escapes, and a
closing quote that is really there. That keeps the lesson to one idea - delimit and
capture the contents - and gives you a Str field on the token to hold the decoded
text. The next lessons layer in escapes, Unicode, and the error when the closing
quote never comes. Assume a well-formed simple string for now.
// add String to Kind; give Token a Str field for the decoded value// on seeing '"', consume characters until the closing '"'// for now assume no backslashes and a closing quote is present// start := i+1; scan to next '"'; Str = input[start:i]