toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final jsonObject = <String, dynamic>{};

  HTInstanceNamespace? curNamespace = namespace;
  while (curNamespace != null) {
    for (final id in curNamespace.symbols.keys) {
      final decl = curNamespace.symbols[id]!;
      if (jsonObject.containsKey(id)) {
        continue;
      }
      jsonObject[id] = decl.value;
    }
    curNamespace = curNamespace.next;
  }
  return jsonObject;
}