void _writeTopLevel()

in tool/generate.dart [123:151]


void _writeTopLevel(List<List> data) {
  final file =
      File('lib/src/generated/top_level.dart').openSync(mode: FileMode.write);

  file.writeStringSync('''
    // Copyright (c) 2018, the Dart project authors.  Please see the AUTHORS file
    // for details. All rights reserved. Use of this source code is governed by a
    // BSD-style license that can be found in the LICENSE file.

    // Don't modify this file by hand! It's generated by tool/generate.dart.

    import '../../term_glyph.dart' as glyph;
  ''');

  for (var glyph in data) {
    for (var line in (glyph[3] as String).split('\n')) {
      file.writeStringSync('/// $line\n');
    }

    file.writeStringSync('''
      ///
      /// If [glyph.ascii] is `false`, this is "${glyph[1]}". If it's `true`, this is
      /// "${glyph[2]}" instead.
      String get ${glyph[0]} => glyph.glyphs.${glyph[0]};
    ''');
  }

  file.closeSync();
}