JSON printer implementation.
class json printer
import ideal • machine • channels • string writer
json printer(character handler the character handler)
this • the character handler = the character handler
private void print value(readonly value the value, string writer result)
private void print string(string the string, string writer result)
result • write('"')
for (the character : the string .> immutable list[character])
if the character == '"' || the character == '\\' || the character == '/'
else if the character == '\b'
else if the character == '\f'
else if the character == '\n'
else if the character == '\r'
else if the character == '\t'
else
result • write all("\\b")
result • write all("\\f")
result • write all("\\n")
result • write all("\\r")
result • write all("\\t")
result • write('"')
private void print list(readonly list[readonly value] the list, string writer result)
private void print dictionary(dictionary[string, readonly value] the dictionary, string writer result)