Skip to content

Commit

Permalink
add missing operations
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz committed Sep 11, 2024
1 parent d7905b2 commit f373cb7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Juvix/Compiler/Tree/Keywords.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import Juvix.Data.Keyword.All
kwFieldDiv,
kwFieldMul,
kwFieldSub,
kwFieldToInt,
kwIntToField,
kwIntToUInt8,
kwLe_,
kwLt_,
Expand All @@ -49,6 +51,7 @@ import Juvix.Data.Keyword.All
kwStrcat,
kwSub_,
kwTrace,
kwUInt8ToInt,
)
import Juvix.Prelude

Expand Down Expand Up @@ -98,5 +101,8 @@ allKeywords =
kwRandomEcPoint,
kwByteArrayLength,
kwByteArrayFromListUInt8,
kwIntToUInt8
kwIntToUInt8,
kwUInt8ToInt,
kwIntToField,
kwFieldToInt
]
3 changes: 3 additions & 0 deletions src/Juvix/Compiler/Tree/Translation/FromSource.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand Down
9 changes: 9 additions & 0 deletions src/Juvix/Data/Keyword/All.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f373cb7

Please sign in to comment.