Skip to content

Commit

Permalink
ogma-core: Modify component spec backend to allow customizing target …
Browse files Browse the repository at this point in the history
…filename. Refs #80.

Ogma does not allow users to specify the name of the target file that should be
used in applications produced from FRET files. Without that extra facility, it
becomes necessary to rename and modify the Copilot/Haskell (or C) files
produced, which detracts from a smooth UX process.

This commit modifies the FRET component specification backend to customize the
name of the target C filenames based on an argument to the backend.
  • Loading branch information
ivanperez-keera committed May 21, 2023
1 parent 0207393 commit b53a7d5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ogma-core/src/Language/Trans/FRETComponentSpec2Copilot.hs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ data FRETComponentSpec2CopilotOptions = FRETComponentSpec2CopilotOptions
{ fretCS2CopilotUseCoCoSpec :: Bool
, fretCS2CopilotIntType :: String
, fretCS2CopilotRealType :: String
, fretCS2CopilotFilename :: String
}

-- | Transform a FRET TL specification into a Copilot specification.
Expand Down Expand Up @@ -249,7 +250,8 @@ fretComponentSpec2Copilot' prefs fretComponentSpec =
main' :: [String]
main' = [ ""
, "main :: IO ()"
, "main = reify spec >>= compile \"fret\""
, "main = reify spec >>= compile \""
++ fretCS2CopilotFilename prefs ++ "\""
]

-- | Return the corresponding type in Copilot matching a given FRET type.
Expand Down

0 comments on commit b53a7d5

Please sign in to comment.