From f373cb79f7d6b678961e2666a4a99ddacd182326 Mon Sep 17 00:00:00 2001 From: Lukasz Czajka Date: Wed, 11 Sep 2024 14:23:12 +0200 Subject: [PATCH] add missing operations --- src/Juvix/Compiler/Tree/Keywords.hs | 8 +++++++- src/Juvix/Compiler/Tree/Translation/FromSource.hs | 3 +++ src/Juvix/Data/Keyword/All.hs | 9 +++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/Juvix/Compiler/Tree/Keywords.hs b/src/Juvix/Compiler/Tree/Keywords.hs index 80bba71258..6be0825b15 100644 --- a/src/Juvix/Compiler/Tree/Keywords.hs +++ b/src/Juvix/Compiler/Tree/Keywords.hs @@ -36,6 +36,8 @@ import Juvix.Data.Keyword.All kwFieldDiv, kwFieldMul, kwFieldSub, + kwFieldToInt, + kwIntToField, kwIntToUInt8, kwLe_, kwLt_, @@ -49,6 +51,7 @@ import Juvix.Data.Keyword.All kwStrcat, kwSub_, kwTrace, + kwUInt8ToInt, ) import Juvix.Prelude @@ -98,5 +101,8 @@ allKeywords = kwRandomEcPoint, kwByteArrayLength, kwByteArrayFromListUInt8, - kwIntToUInt8 + kwIntToUInt8, + kwUInt8ToInt, + kwIntToField, + kwFieldToInt ] diff --git a/src/Juvix/Compiler/Tree/Translation/FromSource.hs b/src/Juvix/Compiler/Tree/Translation/FromSource.hs index 373c535cdd..9da4e1033c 100644 --- a/src/Juvix/Compiler/Tree/Translation/FromSource.hs +++ b/src/Juvix/Compiler/Tree/Translation/FromSource.hs @@ -110,6 +110,9 @@ parseUnop = <|> parseUnaryOp kwFail OpFail <|> parseUnaryOp kwArgsNum (PrimUnop OpArgsNum) <|> parseUnaryOp kwIntToUInt8 (PrimUnop OpIntToUInt8) + <|> parseUnaryOp kwUInt8ToInt (PrimUnop OpUInt8ToInt) + <|> parseUnaryOp kwIntToField (PrimUnop OpIntToField) + <|> parseUnaryOp kwFieldToInt (PrimUnop OpFieldToInt) parseUnaryOp :: (Members '[Reader ParserSig, InfoTableBuilder, State LocalParams] r) => diff --git a/src/Juvix/Data/Keyword/All.hs b/src/Juvix/Data/Keyword/All.hs index 59fc3a4b88..0742e0358d 100644 --- a/src/Juvix/Data/Keyword/All.hs +++ b/src/Juvix/Data/Keyword/All.hs @@ -286,6 +286,15 @@ kwArgsNum = asciiKw Str.instrArgsNum kwIntToUInt8 :: Keyword kwIntToUInt8 = asciiKw Str.instrIntToUInt8 +kwUInt8ToInt :: Keyword +kwUInt8ToInt = asciiKw Str.instrUInt8ToInt + +kwIntToField :: Keyword +kwIntToField = asciiKw Str.instrIntToField + +kwFieldToInt :: Keyword +kwFieldToInt = asciiKw Str.instrFieldToInt + kwByteArrayFromListUInt8 :: Keyword kwByteArrayFromListUInt8 = asciiKw Str.instrByteArrayFromListUInt8