keiro-dsl-0.17.0.0: test/conformance-structural-nominals/Generated/StructuralNominalLeaves/BehaviorSourceMap.hs
-- @generated by keiro-dsl 0.17.0.0 (language keiro-dsl 6) from context structural-nominal-leaves behavior source map; do not edit.
module Generated.StructuralNominalLeaves.BehaviorSourceMap
( BehaviorSourceLocation (..)
, behaviorSourceLocation
, renderBehaviorSourceLocation
) where
import Data.Text (Text)
import Data.Text qualified as T
data BehaviorSourceLocation = BehaviorSourceLocation
{ file :: !FilePath
, line :: !Int
, column :: !Int
}
deriving stock (Eq, Ord, Show)
behaviorSourceLocation :: Text -> Maybe BehaviorSourceLocation
behaviorSourceLocation key = case key of
"behavior-v1-01b677e97ee382b5" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/structural-nominal-leaves.keiro" 105 25)
"behavior-v1-26fa1ba9ca514f81" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/structural-nominal-leaves.keiro" 105 25)
"behavior-v1-5dbbc70789956424" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/structural-nominal-leaves.keiro" 118 3)
"behavior-v1-6cb89110a4e5d4bc" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/structural-nominal-leaves.keiro" 105 16)
"behavior-v1-83a3e25d3520f959" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/structural-nominal-leaves.keiro" 112 3)
"behavior-v1-d8388e1ef8008039" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/structural-nominal-leaves.keiro" 105 10)
_ -> Nothing
renderBehaviorSourceLocation :: Text -> Text
renderBehaviorSourceLocation key = case behaviorSourceLocation key of
Just location -> T.pack location.file <> ":" <> tshow location.line <> ":" <> tshow location.column
Nothing -> "<internal invariant: missing behavior source for " <> key <> ">"
tshow :: Show value => value -> Text
tshow = T.pack . show