packages feed

keiro-dsl-0.21.0.0: test/conformance-mapped-register-construction/Generated/MappedRegisterConstruction/BehaviorSourceMap.hs

-- @generated by keiro-dsl 0.21.0.0 (language keiro-dsl 6) from context mapped-register-construction behavior source map; do not edit.
module Generated.MappedRegisterConstruction.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-0cc99c7503ca9831" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 47 3)
  "behavior-v1-1f04e07a5ea312c1" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 21 22)
  "behavior-v1-325f4ed937c478c5" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 21 30)
  "behavior-v1-33fcaede253a4bed" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 21 10)
  "behavior-v1-386bbbf74705f45f" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 53 3)
  "behavior-v1-466916eb8981b08e" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 21 22)
  "behavior-v1-5253e620452fc4cf" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 59 3)
  "behavior-v1-5e7d15bcad88b1ae" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 21 10)
  "behavior-v1-66c78f3ed9bc6b52" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 21 22)
  "behavior-v1-7705536a045d1c60" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 68 3)
  "behavior-v1-88ef8671c7c631bb" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 21 10)
  "behavior-v1-959d3fbbbce2b4e4" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 21 30)
  "behavior-v1-968db04037ee20f0" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 21 30)
  "behavior-v1-994dec94076c02d0" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 36 3)
  "behavior-v1-9b56eeea9fa900fd" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 21 16)
  "behavior-v1-a1419cde22483b02" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 21 16)
  "behavior-v1-a8c781dd6ca46f4b" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 21 22)
  "behavior-v1-b7cc059e78b68a92" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 42 3)
  "behavior-v1-c1dbeb960bc50979" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 21 16)
  "behavior-v1-c8967a7d2e58d904" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 21 10)
  "behavior-v1-cc4529515153ea38" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 21 30)
  "behavior-v1-d87956d864ea179b" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 21 30)
  "behavior-v1-da9ee154eb2f350c" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 21 16)
  "behavior-v1-dddc6f0d9aa7b262" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 21 10)
  "behavior-v1-f2c991f59a1a8e7e" -> Just (BehaviorSourceLocation "keiro-dsl/test/fixtures/mapped-register-construction.keiro" 64 3)
  _ -> 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