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 {
352352 fileID: fileID,
353353 fileName: fileName,
354354 offset: loc. offset,
355- line: loc. line! ,
356- column: loc. column! ) )
355+ line: loc. line,
356+ column: loc. column) )
357357 }
358358}
Original file line number Diff line number Diff line change @@ -38,13 +38,11 @@ public struct FileIDMacro: ExpressionMacro {
3838 of macro: Node ,
3939 in context: Context
4040 ) 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 {
4442 throw CustomError . message ( " can't find location for macro " )
4543 }
4644
47- let fileLiteral : ExprSyntax = " \( literal: fileID ) "
45+ let fileLiteral : ExprSyntax = " \( literal: sourceLoc . file ) "
4846 return fileLiteral. with ( \. leadingTrivia, macro. leadingTrivia)
4947 }
5048}
@@ -724,7 +722,7 @@ public enum LeftHandOperandFinderMacro: ExpressionMacro {
724722 fatalError ( " missing source location information " )
725723 }
726724
727- print ( " Source range for LHS is \( lhsStartLoc. file! ) : \( lhsStartLoc. line! ) : \( lhsStartLoc. column! ) - \( lhsEndLoc. line! ) : \( lhsEndLoc. column! ) " )
725+ print ( " Source range for LHS is \( lhsStartLoc. file) : \( lhsStartLoc. line) : \( lhsStartLoc. column) - \( lhsEndLoc. line) : \( lhsEndLoc. column) " )
728726
729727 return . visitChildren
730728 }
You can’t perform that action at this time.
0 commit comments