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
0c1571ee
Commit
0c1571ee
authored
Apr 22, 2014
by
Pietro Abate
Browse files
One more test. Minor changes
parent
c53f95c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/lambda/src/compute.ml
View file @
0c1571ee
...
...
@@ -51,13 +51,14 @@ let rec _to_typed env l expr =
let
line
=
Loc
.
start_line
origloc
in
let
cbegin
=
Loc
.
start_off
origloc
-
Loc
.
start_bol
origloc
in
let
cend
=
Loc
.
stop_off
origloc
-
Loc
.
start_bol
origloc
in
let
index
,
vtype
=
(
try
Locals
.
find
vname
l
with
Not_found
->
Printf
.
eprintf
let
index
,
vtype
=
try
Locals
.
find
vname
l
with
Not_found
->
Printf
.
eprintf
"File %s, line %d, characters %d-%d:
\n
Unbound identifier %s
\n
"
(
Loc
.
file_name
origloc
)
line
cbegin
cend
vname
;
raise
Error
)
(
Loc
.
file_name
origloc
)
line
cbegin
cend
vname
;
raise
Error
in
let
t
=
(* Ident.Env.find index env.Compile.gamma *)
vtype
in
let
v
=
if
Types
.
no_var
t
then
Var
(
index
,
vname
)
else
TVar
(
index
,
vname
)
let
v
=
if
Types
.
no_var
vtype
then
Var
(
index
,
vname
)
else
TVar
(
index
,
vname
)
in
env
,
l
,
{
exp_loc
=
loc
;
exp_typ
=
t
;
exp_descr
=
v
}
|
Int
(
_
,
i
)
->
let
i
=
Big_int
.
big_int_of_int
i
in
...
...
tests/lambda/src/main.ml
View file @
0c1571ee
...
...
@@ -25,10 +25,18 @@ let tests_poly_abstr = [
"Test CDuce.lambda.const_abstr failed"
,
"Abstraction(Dummy,,,,Sel(,(Int -> Int),{}))"
,
"fun f x : Int : Int -> 2"
;
"Test CDuce.lambda.poly.identity failed"
,
"Abstraction(Dummy,,,,Sel(,([ Char* ] | Int -> [ Char* ] | Int),Comp({},{ { (`$A/
[ Char* ]) } ,{ (`$A/Int) } })))"
,
"(fun f x : 'A{A/Int;A/String} : 'A{A/Int;A/String} -> x) {A/Int;A/String}"
;
"Test CDuce.runtime.poly.tail failed"
,
"Abstraction(([ (`$A & Int | Char | Atom | (Any,Any) | <(Any) (Any)>Any \
| Arrow)* ], [ (`$A & Int | Char | Atom | (Any,Any) | <(Any) (Any)>Any | \
Arrow)* ]),{})"
,
"fun tail x : ['A{}] : ['A{}] -> match x : ['A{}] with | (el : 'A{}) :: (rest : ['A{}]) -> rest"
;
]
let
tests_compile
=
"CDuce compile tests (Typed -> Lambda )"
>:::
...
...
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