Skip to content

Commit

Permalink
Add anoma-verify-detached to tree parser
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcadman committed May 17, 2024
1 parent 1d5e76c commit 0e8e4cb
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Juvix/Compiler/Tree/Keywords.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Juvix.Data.Keyword.All
kwAnomaDecode,
kwAnomaEncode,
kwAnomaGet,
kwAnomaVerifyDetached,
kwArgsNum,
kwAtoi,
kwBr,
Expand Down Expand Up @@ -78,6 +79,7 @@ allKeywords =
kwAnomaGet,
kwAnomaDecode,
kwAnomaEncode,
kwAnomaVerifyDetached,
kwPoseidon,
kwEcOp,
kwRandomEcPoint
Expand Down
1 change: 1 addition & 0 deletions src/Juvix/Compiler/Tree/Translation/FromSource.hs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ parseAnoma =
parseAnoma' kwAnomaGet OpAnomaGet
<|> parseAnoma' kwAnomaDecode OpAnomaDecode
<|> parseAnoma' kwAnomaEncode OpAnomaEncode
<|> parseAnoma' kwAnomaVerifyDetached OpAnomaVerifyDetached

parseAnoma' ::
(Members '[Reader ParserSig, InfoTableBuilder, State LocalParams] r) =>
Expand Down
4 changes: 4 additions & 0 deletions src/Juvix/Data/Keyword/All.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ where

import Juvix.Data.Keyword
import Juvix.Extra.Strings qualified as Str
import Juvix.Extra.Strings qualified as Std

kwAs :: Keyword
kwAs = asciiKw Str.as
Expand Down Expand Up @@ -451,6 +452,9 @@ kwAnomaDecode = asciiKw Str.anomaDecode
kwAnomaEncode :: Keyword
kwAnomaEncode = asciiKw Str.anomaEncode

kwAnomaVerifyDetached :: Keyword
kwAnomaVerifyDetached = asciiKw Std.anomaVerifyDetached

delimBraceL :: Keyword
delimBraceL = mkDelim Str.braceL

Expand Down
6 changes: 5 additions & 1 deletion test/Tree/Transformation/CheckNoAnoma.hs
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,9 @@ tests =
Eval.NegTest
"anomaEncode"
$(mkRelDir ".")
$(mkRelFile "test011.jvt")
$(mkRelFile "test011.jvt"),
Eval.NegTest
"anomaVerifyDetached"
$(mkRelDir ".")
$(mkRelFile "test012.jvt")
]
5 changes: 5 additions & 0 deletions tests/Tree/negative/test012.jvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- calling unsupported anoma-verify-detached

function main() : * {
anoma-verify-detached(1,2,3)
}

0 comments on commit 0e8e4cb

Please sign in to comment.