X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=VHDL.hs;h=13a92942e171508e13ddffcf8287a04091422a5d;hb=f5f6d286f56ee1e822ece0258039ba2d2ce920aa;hp=e2eb962742ce4616a9cd1eae3a44fcd299fd7671;hpb=1a10d214e6ffc7097c0f4bddf16f0dd87b5355a8;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git a/VHDL.hs b/VHDL.hs index e2eb962..13a9294 100644 --- a/VHDL.hs +++ b/VHDL.hs @@ -47,12 +47,11 @@ createDesignFiles binds = map (Arrow.second $ AST.DesignFile full_context) units where - init_session = VHDLState Map.empty Map.empty Map.empty + init_session = VHDLState Map.empty [] Map.empty Map.empty (units, final_session) = State.runState (createLibraryUnits binds) init_session tyfun_decls = map snd $ Map.elems (final_session ^.vsTypeFuns) - ty_decls = map mktydecl $ Map.elems (final_session ^. vsTypes) - --vec_decls = map (\(v_id, v_def) -> AST.PDITD $ AST.TypeDec v_id v_def) (Map.elems (final_session ^. vsElemTypes)) + ty_decls = final_session ^.vsTypeDecls tfvec_index_decl = AST.PDISD $ AST.SubtypeDec tfvec_indexTM tfvec_index_def tfvec_range = AST.ConstraintRange $ AST.SubTypeRange (AST.PrimLit "-1") (AST.PrimName $ AST.NAttribute $ AST.AttribName (AST.NSimple integerTM) highId Nothing) tfvec_index_def = AST.SubtypeIn integerTM (Just tfvec_range) @@ -69,9 +68,6 @@ createDesignFiles binds = type_package_body = AST.LUPackageBody $ AST.PackageBody typesId tyfun_decls subProgSpecs = map subProgSpec tyfun_decls subProgSpec = \(AST.SubProgBody spec _ _) -> AST.PDISS spec - mktydecl :: (AST.VHDLId, Either AST.TypeDef AST.SubtypeIn) -> AST.PackageDecItem - mktydecl (ty_id, Left ty_def) = AST.PDITD $ AST.TypeDec ty_id ty_def - mktydecl (ty_id, Right ty_def) = AST.PDISD $ AST.SubtypeDec ty_id ty_def -- Create a use foo.bar.all statement. Takes a list of components in the used -- name. Must contain at least two components