File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
lib/ASTGen/Sources/ASTGen Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -352,7 +352,7 @@ extension PluginMessage.Syntax {
352
352
fileID: fileID,
353
353
fileName: fileName,
354
354
offset: loc. offset,
355
- line: loc. line! ,
356
- column: loc. column! ) )
355
+ line: loc. line,
356
+ column: loc. column) )
357
357
}
358
358
}
Original file line number Diff line number Diff line change @@ -38,13 +38,11 @@ public struct FileIDMacro: ExpressionMacro {
38
38
of macro: Node ,
39
39
in context: Context
40
40
) throws -> ExprSyntax {
41
- guard let sourceLoc = context. location ( of: macro) ,
42
- let fileID = sourceLoc. file
43
- else {
41
+ guard let sourceLoc = context. location ( of: macro) else {
44
42
throw CustomError . message ( " can't find location for macro " )
45
43
}
46
44
47
- let fileLiteral : ExprSyntax = " \( literal: fileID ) "
45
+ let fileLiteral : ExprSyntax = " \( literal: sourceLoc . file ) "
48
46
return fileLiteral. with ( \. leadingTrivia, macro. leadingTrivia)
49
47
}
50
48
}
@@ -711,7 +709,7 @@ public enum LeftHandOperandFinderMacro: ExpressionMacro {
711
709
fatalError ( " missing source location information " )
712
710
}
713
711
714
- print ( " Source range for LHS is \( lhsStartLoc. file! ) : \( lhsStartLoc. line! ) : \( lhsStartLoc. column! ) - \( lhsEndLoc. line! ) : \( lhsEndLoc. column! ) " )
712
+ print ( " Source range for LHS is \( lhsStartLoc. file) : \( lhsStartLoc. line) : \( lhsStartLoc. column) - \( lhsEndLoc. line) : \( lhsEndLoc. column) " )
715
713
716
714
return . visitChildren
717
715
}
You can’t perform that action at this time.
0 commit comments