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 @@ -380,7 +380,7 @@ extension PluginMessage.Syntax {
380
380
fileID: fileID,
381
381
fileName: fileName,
382
382
offset: loc. offset,
383
- line: loc. line! ,
384
- column: loc. column! ) )
383
+ line: loc. line,
384
+ column: loc. column) )
385
385
}
386
386
}
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
49
47
}
50
48
}
@@ -746,7 +744,7 @@ public enum LeftHandOperandFinderMacro: ExpressionMacro {
746
744
fatalError ( " missing source location information " )
747
745
}
748
746
749
- print ( " Source range for LHS is \( lhsStartLoc. file! ) : \( lhsStartLoc. line! ) : \( lhsStartLoc. column! ) - \( lhsEndLoc. line! ) : \( lhsEndLoc. column! ) " )
747
+ print ( " Source range for LHS is \( lhsStartLoc. file) : \( lhsStartLoc. line) : \( lhsStartLoc. column) - \( lhsEndLoc. line) : \( lhsEndLoc. column) " )
750
748
751
749
return . visitChildren
752
750
}
You can’t perform that action at this time.
0 commit comments