keiro-dsl-0.12.0.0: test/conformance-process-runtime/Generated/HospitalCapacity/BehaviorSourceMap.hs
-- @generated by keiro-dsl 0.12.0.0 (language keiro-dsl 4) from context hospital-capacity behavior source map; do not edit.
module Generated.HospitalCapacity.BehaviorSourceMap
( BehaviorSourceLocation (..)
, behaviorSourceLocation
, renderBehaviorSourceLocation
) where
import Data.Text (Text)
import Data.Text qualified as T
data BehaviorSourceLocation = BehaviorSourceLocation
{ sourceFile :: !FilePath
, sourceLine :: !Int
, sourceColumn :: !Int
}
deriving stock (Eq, Ord, Show)
behaviorSourceLocation :: Text -> Maybe BehaviorSourceLocation
behaviorSourceLocation key = case key of
"behavior-v1-5198a253324042e6" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/hospital-surge.keiro" 44 3)
"behavior-v1-6721e0b61aa38780" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/hospital-surge.keiro" 45 3)
"behavior-v1-69ac3daa8569d350" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/hospital-surge.keiro" 54 3)
_ -> Nothing
renderBehaviorSourceLocation :: Text -> Text
renderBehaviorSourceLocation key = case behaviorSourceLocation key of
Just location -> T.pack (sourceFile location) <> ":" <> tshow (sourceLine location) <> ":" <> tshow (sourceColumn location)
Nothing -> "<internal invariant: missing behavior source for " <> key <> ">"
tshow :: Show value => value -> Text
tshow = T.pack . show