Skip to content

Commit c540121

Browse files
committed
InternalBytes: Rename fields for uniformity
1 parent a17f40e commit c540121

File tree

6 files changed

+24
-26
lines changed

6 files changed

+24
-26
lines changed

kore/src/Kore/Builtin/InternalBytes.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,12 @@ patternVerifierHook =
149149
patternVerifierWorker external =
150150
case externalChild of
151151
StringLiteral_ literal -> do
152-
bytesValue <- Builtin.parseString Encoding.parse8Bit literal
152+
internalBytesValue <- Builtin.parseString Encoding.parse8Bit literal
153153
(return . InternalBytesF . Const)
154-
InternalBytes { bytesSort, bytesValue }
154+
InternalBytes { internalBytesSort, internalBytesValue }
155155
_ -> Kore.Error.koreFail "Expected literal string"
156156
where
157-
DomainValue { domainValueSort = bytesSort } = external
157+
DomainValue { domainValueSort = internalBytesSort } = external
158158
DomainValue { domainValueChild = externalChild } = external
159159

160160
dotBytes :: IsString str => str
@@ -168,11 +168,11 @@ dotBytesVerifier =
168168
worker application = do
169169
unless (null arguments) (Kore.Error.koreFail "expected zero arguments")
170170
(return . InternalBytesF . Const)
171-
InternalBytes { bytesSort, bytesValue = Encoding.encode8Bit "" }
171+
InternalBytes { internalBytesSort, internalBytesValue = Encoding.encode8Bit "" }
172172
where
173173
arguments = applicationChildren application
174174
symbol = applicationSymbolOrAlias application
175-
bytesSort = applicationSortsResult . symbolSorts $ symbol
175+
internalBytesSort = applicationSortsResult . symbolSorts $ symbol
176176

177177
matchBuiltinBytes :: Monad m => TermLike variable -> MaybeT m ByteString
178178
matchBuiltinBytes (InternalBytes_ _ byteString) = return byteString

kore/src/Kore/Builtin/InternalBytes/InternalBytes.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ asTermLike
9393
:: InternalVariable variable
9494
=> InternalBytes -- ^ builtin value to render
9595
-> TermLike variable
96-
asTermLike InternalBytes { bytesSort, bytesValue } =
96+
asTermLike InternalBytes { internalBytesSort, internalBytesValue } =
9797
mkDomainValue DomainValue
98-
{ domainValueSort = bytesSort
99-
, domainValueChild = mkStringLiteral $ Encoding.decode8Bit bytesValue
98+
{ domainValueSort = internalBytesSort
99+
, domainValueChild = mkStringLiteral $ Encoding.decode8Bit internalBytesValue
100100
}
101101

102102
internalize

kore/src/Kore/Internal/InternalBytes.hs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ import Kore.Unparser
2727

2828
data InternalBytes =
2929
InternalBytes
30-
{ bytesSort :: !Sort
31-
, bytesValue :: !ByteString
30+
{ internalBytesSort :: !Sort
31+
, internalBytesValue :: !ByteString
3232
}
3333
deriving (Eq, Ord, Show)
3434
deriving (GHC.Generic)
@@ -39,20 +39,20 @@ data InternalBytes =
3939
instance Unparse InternalBytes where
4040
unparse internalBytes@(InternalBytes _ _) =
4141
"\\dv"
42-
<> parameters [bytesSort]
43-
<> arguments [StringLiteral (Encoding.toBase16 bytesValue)]
42+
<> parameters [internalBytesSort]
43+
<> arguments [StringLiteral (Encoding.toBase16 internalBytesValue)]
4444
where
45-
InternalBytes { bytesSort, bytesValue } = internalBytes
45+
InternalBytes { internalBytesSort, internalBytesValue } = internalBytes
4646

4747
unparse2 internalBytes@(InternalBytes _ _) =
4848
"\\dv2"
49-
<> parameters2 [bytesSort]
50-
<> arguments2 [StringLiteral (Encoding.toBase16 bytesValue)]
49+
<> parameters2 [internalBytesSort]
50+
<> arguments2 [StringLiteral (Encoding.toBase16 internalBytesValue)]
5151
where
52-
InternalBytes { bytesSort, bytesValue } = internalBytes
52+
InternalBytes { internalBytesSort, internalBytesValue } = internalBytes
5353

5454
instance Synthetic Sort (Const InternalBytes) where
55-
synthetic = bytesSort . getConst
55+
synthetic = internalBytesSort . getConst
5656
{-# INLINE synthetic #-}
5757

5858
instance Synthetic (FreeVariables variable) (Const InternalBytes) where

kore/src/Kore/Internal/TermLike.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,8 +1462,8 @@ mkInternalBytes
14621462
mkInternalBytes sort value =
14631463
updateCallStack . synthesize . InternalBytesF . Const
14641464
$ InternalBytes
1465-
{ bytesSort = sort
1466-
, bytesValue = value
1465+
{ internalBytesSort = sort
1466+
, internalBytesValue = value
14671467
}
14681468

14691469
mkInternalBytes'
@@ -1900,9 +1900,9 @@ pattern Bottom_ bottomSort <-
19001900
(Recursive.project -> _ :< BottomF Bottom { bottomSort })
19011901

19021902
pattern InternalBytes_ :: Sort -> ByteString -> TermLike variable
1903-
pattern InternalBytes_ bytesSort bytesValue <-
1903+
pattern InternalBytes_ internalBytesSort internalBytesValue <-
19041904
(Recursive.project -> _ :< InternalBytesF (Const InternalBytes
1905-
{ bytesSort, bytesValue }
1905+
{ internalBytesSort, internalBytesValue }
19061906
))
19071907

19081908
pattern Ceil_ ceilOperandSort ceilResultSort ceilChild <-

kore/src/Kore/Internal/TermLike/TermLike.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,8 +793,8 @@ instance
793793
EndiannessF (Const endianness) -> locationFromAst endianness
794794
InternalBoolF (Const InternalBool { internalBoolSort }) ->
795795
locationFromAst internalBoolSort
796-
InternalBytesF (Const InternalBytes { bytesSort }) ->
797-
locationFromAst bytesSort
796+
InternalBytesF (Const InternalBytes { internalBytesSort }) ->
797+
locationFromAst internalBytesSort
798798
InternalIntF (Const InternalInt { internalIntSort }) ->
799799
locationFromAst internalIntSort
800800
InternalStringF (Const InternalString { internalStringSort }) ->

kore/test/Test/Kore/Builtin/InternalBytes.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ import qualified Data.Text as T
4242
import qualified Kore.Builtin.Encoding as E
4343
import qualified Kore.Builtin.InternalBytes as InternalBytes
4444
import Kore.Internal.Pattern
45-
import Kore.Internal.TermLike hiding
46-
( bytesSort
47-
)
45+
import Kore.Internal.TermLike
4846
import qualified Pretty
4947

5048
import Test.Kore.Builtin.Builtin

0 commit comments

Comments
 (0)