Position.fromJson constructor

Position.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory Position.fromJson(Map<String, Object?> json) {
  return Position(
    filename: switch (json['filename']) {
      final String filename => Uri.parse(filename),
      _ => null,
    },
    offset: json['offset'] as int,
    line: json['line'] as int,
    column: json['column'] as int,
  );
}