tokensToJson function
Encodes a per-line token list (as returned by tokenization) to JSON,
applying themedTokenToJson to each token.
Implementation
List<dynamic> tokensToJson(List<List<ThemedToken>> lines) =>
lines.map((line) => line.map(themedTokenToJson).toList()).toList();