X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=TranslatorTypes.hs;h=72cd3981f97624175c816c50fd094fc330a4b9ae;hb=40ece4d80b50d59c781b9bc157f5379c3a3bb14a;hp=4ced7de59b5bd5c28a23ebb7a398f322b5251729;hpb=535eeae192a34920407f47626fea2534bb5c263b;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git a/TranslatorTypes.hs b/TranslatorTypes.hs index 4ced7de..72cd398 100644 --- a/TranslatorTypes.hs +++ b/TranslatorTypes.hs @@ -46,6 +46,12 @@ setFlatFunc hsfunc flatfunc = do let fs'= Map.adjust (\d -> d { flatFunc = Just flatfunc }) hsfunc fs State.modify (\x -> x {funcs = fs' }) +modFunc :: HsFunction -> (HsFunction -> FuncData -> FuncData) -> VHDLState () +modFunc hsfunc f = do + fs <- State.gets funcs -- Get the funcs element from the session + let fs' = Map.adjustWithKey f hsfunc fs + State.modify (\x -> x {funcs = fs' }) + getModule :: VHDLState HscTypes.CoreModule getModule = State.gets coreMod -- Get the coreMod element from the session