visitDocument method

  1. @override
void visitDocument(
  1. TomlDocument document
)
override

Visits the given document.

Implementation

@override
void visitDocument(TomlDocument document) {
  _separatedBy(
    document.expressions,
    write: visitExpression,
    writeSeparator: (next) {
      // All expressions are are on a line by themselves but there is an
      // additional blank line before every table header (except if it is
      // the very first expression of the document).
      if (next is TomlTable) _writeNewline();
      _writeNewline();
    },
  );
  // There should be a newline at the end of every file.
  _writeNewline();
}