serialize method

Map<String, dynamic> serialize()

Serialize all declarations to a JSON object.

Implementation

Map<String, dynamic> serialize() {
  return {
    'classes': _classes.map((e) => e.toJson()).toList(),
    'enums': _enums.map((e) => e.toJson()).toList(),
    'functions': _functions.map((e) => e.toJson()).toList(),
    'sources': _sources
        .map((e) => {'uri': e.uri.toString(), 'source': e.toString()})
        .toList(),
  };
}