Skip to content

Parse signed hex values #2258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kore/src/Kore/Builtin/String.hs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ evalString2Base = Builtin.functionEvaluator evalString2Base0
[(result, "")] -> Right (result, "")
_ -> Left ""
10 -> Text.signed Text.decimal
16 -> Text.hexadecimal
16 -> Text.signed Text.hexadecimal
_ -> const empty
case readN _str of
Right (result, Text.unpack -> "") ->
Expand Down
6 changes: 3 additions & 3 deletions kore/test/Test/Kore/Builtin/String.hs
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,10 @@ test_string2Base =
[asInternal "42", Test.Int.asInternal 16]
(Test.Int.asPattern 66)
, Test.Int.testInt
"string2Base hex negative is bottom"
"string2Base hex negative"
string2BaseStringSymbol
[asInternal "-42", Test.Int.asInternal 16]
bottom
(Test.Int.asPattern (-66))
, Test.Int.testInt
"string2Base hex is bottom"
string2BaseStringSymbol
Expand All @@ -317,7 +317,7 @@ test_string2Base =
[asInternal "foobar", Test.Int.asInternal 16]
bottom
, Test.Int.testInt
"string2Base hex from hex is bottom"
"string2Base hex from hex"
string2BaseStringSymbol
[asInternal "baad", Test.Int.asInternal 16]
(Test.Int.asPattern 47789)
Expand Down