The function SourceLocation::isEmpty() had somewhat dual role.
Sometimes it indicates that the SourceLocation is invalid.
Sometimes it means that there is no corresponding source text.
Hence the proposal is to replace it with two functions, isValid() and hasText().
I also removed Scanner::sourceAt(). (Do we have a rule of thumb to remove unused code?)
Since hasText() checks that start and end are valid indices for source, I adjusted a couple of tests to avoid empty source strings.
Also:
- Use {}-style list initialisation for SourceLocation construction
- Introduce new system includes
- Changes the API of the Scanner to take source as value (with move) as opposed to as a reference