From b1d6d8af0e31123d46e102bc68fcfd02d3b51256 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Sun, 30 Jan 2022 00:37:05 +0100 Subject: ... --- src/Tonkadur/Compute.elm | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/Tonkadur/Compute.elm') diff --git a/src/Tonkadur/Compute.elm b/src/Tonkadur/Compute.elm index 149f37d..a75ef7c 100644 --- a/src/Tonkadur/Compute.elm +++ b/src/Tonkadur/Compute.elm @@ -108,6 +108,7 @@ cast state from to param = ) "float" -> (Tonkadur.Types.FloatValue (toFloat int)) + "bool" -> (Tonkadur.Types.BoolValue (not (int == 0))) "int" -> (Tonkadur.Types.IntValue int) _ -> (unsupported_cast from to) @@ -130,6 +131,11 @@ cast state from to param = Nothing -> (unsupported_cast from to) (Just result) -> (Tonkadur.Types.IntValue result) + "bool" -> + (Tonkadur.Types.BoolValue + ((String.toLower (String.trim as_string)) == "true") + ) + "text" -> (Tonkadur.Types.TextValue text_v) _ -> (unsupported_cast from to) @@ -146,6 +152,11 @@ cast state from to param = Nothing -> (unsupported_cast from to) (Just result) -> (Tonkadur.Types.IntValue result) + "bool" -> + (Tonkadur.Types.BoolValue + ((String.toLower (String.trim string)) == "true") + ) + "text" -> (Tonkadur.Types.TextValue (Tonkadur.Types.StringText string)) -- cgit v1.2.3-70-g09d2