File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ module Language.Fortran.Parser
36
36
-- * F77 with inlined includes
37
37
-- $f77includes
38
38
, f77lIncludes
39
+ , f77lIncIncludes
39
40
) where
40
41
41
42
import Language.Fortran.AST
@@ -253,6 +254,18 @@ f77lIncludes incs mods fn bs = do
253
254
pf''
254
255
return pf'''
255
256
257
+ -- | Entry point for include files
258
+ --
259
+ -- We can't perform full analysis (though it might be possible to do in future)
260
+ -- but the AST is enough for certain types of analysis/refactoring
261
+ f77lIncIncludes
262
+ :: [FilePath ] -> String -> B. ByteString -> IO [Block A0 ]
263
+ f77lIncIncludes incs fn bs =
264
+ case makeParserFixed F77. includesParser Fortran77Legacy fn bs of
265
+ Left e -> liftIO $ throwIO e
266
+ Right bls ->
267
+ evalStateT (descendBiM (f77lIncludesInline incs [] ) bls) Map. empty
268
+
256
269
f77lIncludesInner :: Parser [Block A0 ]
257
270
f77lIncludesInner = makeParserFixed F77. includesParser Fortran77Legacy
258
271
You can’t perform that action at this time.
0 commit comments