toJson method

  1. @override
Map<String, dynamic> toJson()
override

Implementation

@override
Map<String, dynamic> toJson() => <String, Object?>{
      'type': type,
      'index': index ?? -1,
      if (function?.toJson() case final functionValue?)
        'function': functionValue,
      if (code?.toJson() case final codeValue?) 'code': codeValue,
      if (location?.toJson() case final locationValue?)
        'location': locationValue,
      if (vars?.map((f) => f.toJson()).toList() case final varsValue?)
        'vars': varsValue,
      if (kind case final kindValue?) 'kind': kindValue,
    };