SourceReference constructor
SourceReference(
- SourceSpan sourceSpan,
- CompileDirectiveMetadata? compileDirectiveMetadata
Returns a SourceReference accounting for the templateOffset.
Implementation
factory SourceReference(SourceSpan sourceSpan,
CompileDirectiveMetadata? compileDirectiveMetadata) {
var templateOffset =
compileDirectiveMetadata?.template?.templateOffset ?? 0;
return SourceReference._(sourceSpan.start.offset + templateOffset,
sourceSpan.end.offset + templateOffset, sourceSpan.sourceUrl!);
}