@@ -97,6 +97,8 @@ data Elab : Type -> Type where
9797 GetReferredFns : Name -> Elab (List Name)
9898 -- Get the name of the current and outer functions, if it is applicable
9999 GetCurrentFn : Elab (SnocList Name)
100+ -- Get the source location of the macro call site
101+ GetFC : Elab FC
100102 -- Check a group of top level declarations
101103 Declare : List Decl -> Elab ()
102104
@@ -203,6 +205,9 @@ interface Monad m => Elaboration m where
203205 ||| Get the name of the current and outer functions, if we are in a function
204206 getCurrentFn : m (SnocList Name)
205207
208+ ||| Get the source location of the macro call site.
209+ getFC : m FC
210+
206211 ||| Make some top level declarations
207212 declare : List Decl -> m ()
208213
@@ -253,6 +258,7 @@ Elaboration Elab where
253258 getCons = GetCons
254259 getReferredFns = GetReferredFns
255260 getCurrentFn = GetCurrentFn
261+ getFC = GetFC
256262 declare = Declare
257263 readFile = ReadFile
258264 writeFile = WriteFile
@@ -281,6 +287,7 @@ Elaboration m => MonadTrans t => Monad (t m) => Elaboration (t m) where
281287 getCons = lift . getCons
282288 getReferredFns = lift . getReferredFns
283289 getCurrentFn = lift getCurrentFn
290+ getFC = lift getFC
284291 declare = lift . declare
285292 readFile = lift .: readFile
286293 writeFile d = lift .: writeFile d
0 commit comments