@@ -51,7 +51,7 @@ data Option = TTypeInTType
5151-- | Source location. These are typically produced by the parser 'Idris.Parser.getFC'
5252data FC = FC { _fc_fname :: String, -- ^ Filename
5353 _fc_start :: (Int, Int), -- ^ Line and column numbers for the start of the location span
54− fc_end :: (Int, Int) -- ^ Line and column numbers for the end of the location span
54+ _fc_end :: (Int, Int) -- ^ Line and column numbers for the end of the location span
5555 }
5656 | NoFC -- ^ Locations for machine-generated terms
5757 | FileFC { _fc_fname :: String } -- ^ Locations with file only
@@ -65,12 +65,19 @@ fc_fname NoFC = "(no file)"
6565fc_fname (FileFC f) = f
6666
6767-- TODO: find uses and destroy them, doing this case analysis at call sites
68−-- | Give a notion of filename associated with an FC
68+-- | Give a notion of start location associated with an FC
6969fc_start :: FC -> (Int, Int)
7070fc_start (FC _ start _) = start
7171fc_start NoFC = (0, 0)
7272fc_start (FileFC f) = (0, 0)
7373
74+-- TODO: find uses and destroy them, doing this case analysis at call sites
75+-- | Give a notion of end location associated with an FC
76+fc_end :: FC -> (Int, Int)
77+fc_end (FC _ _ end) = end
78+fc_end NoFC = (0, 0)
79+fc_end (FileFC f) = (0, 0)
80+
7481-- | Get the largest span containing the two FCs
7582spanFC :: FC -> FC -> FC
7683spanFC (FC f start end) (FC f' start' end')