Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
5022e868
Commit
5022e868
authored
May 28, 2014
by
Julien Lopez
Browse files
[TESTS][LAMBDA][MINOR] Fix a test; add Op to the lambda printer
parent
29dc26a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/lambda/src/lambdaTests.ml
View file @
5022e868
...
...
@@ -232,8 +232,8 @@ let tests_eval = "CDuce runtime tests (Typed -> Lambda -> Value)" >:::
assert_equal
~
msg
:
"Test CDuce.runtime.misc.map_even_hard failed"
~
printer
:
(
fun
x
->
x
)
"(Atom(true),(
\"
hey
\"
,((3,(5,Atom(nil),Id),{ { `$A = Int } ,{ `$A = Bool
} }),(Atom(true),(Abstraction((`$C,`$C),
Comp(
{ { `$A = Int } ,{ `$A =
Bool } },Sel(1,(`$C -> `$C),Id))
),(Atom(false),Atom(nil),Id),Id),Id),Id),Id),Id)"
} }),(Atom(true),(Abstraction((`$C,`$C),{ { `$A = Int } ,{ `$A =
Bool
} }
),(Atom(false),Atom(nil),Id),Id),Id),Id),Id),Id)"
(
run_test_eval
"(fun map f : ('A->'B) x : ['A] : ['B] ->
match x : ['A] with
| (el : 'A) :: (rest : ['A]) -> ((f.el), ((map.f).rest))
...
...
tests/lambda/src/printer.ml
View file @
5022e868
...
...
@@ -245,6 +245,7 @@ and pp_lambda ppf =
|
Pair
(
e1
,
e2
)
->
Format
.
fprintf
ppf
"Pair(%a, %a)"
pp_lambda
e1
pp_lambda
e2
|
String
(
_
)
->
Format
.
fprintf
ppf
"String"
|
Match
(
e
,
brs
)
->
Format
.
fprintf
ppf
"Match(%a, %a)"
pp_lambda
e
pp_lbranches
brs
|
Op
(
str
,
le
)
->
Format
.
fprintf
ppf
"Op(%s, ("
str
;
print_lst
pp_lambda
ppf
le
;
Format
.
fprintf
ppf
"))"
|
_
->
()
and
pp_lbranches
ppf
brs
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment