Formats a source location as a human-readable string.
Returns the file part of a source location, or undefined if no file is set.
Optionalfile: stringCreates a source location from a source range and a file name.
undefined if the given range is undefined
SourceRange.fromNode for getting the range from an AST node
Returns the source range part of a source location.
Returns an invalid source location (i.e., with an invalid range and no file).
Checks if the first location is a subset of the second location. For this, they must be in the same file!
Maps the file part of a source location using the given mapper function.
Merges multiple source locations into a single source location that spans from the earliest start to the latest end.
If the locations are from different files, undefined is returned.
Files may be undefined themselves, but if there is at least one defined file, they must all be the same defined file for the merge to succeed.
Utility functions for source locations.