keiro-dsl-0.18.0.0: test/conformance-structural-text-sets/Generated/StructuralTextSets/BehaviorSourceMap.hs
-- @generated by keiro-dsl 0.18.0.0 (language keiro-dsl 6) from context structural-text-sets behavior source map; do not edit.
module Generated.StructuralTextSets.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-21ff727d241ecd71" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/structural-text-sets.keiro" 55 3)
"behavior-v1-3fe9a1bf4f7fe73f" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/structural-text-sets.keiro" 41 16)
"behavior-v1-7f54aab10d4d248f" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/structural-text-sets.keiro" 41 10)
"behavior-v1-bf90d9e010468fdc" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/structural-text-sets.keiro" 49 3)
"behavior-v1-c15c80eb55d3be38" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/structural-text-sets.keiro" 41 16)
_ -> 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