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
5ce3a562
Commit
5ce3a562
authored
May 26, 2014
by
Pietro Abate
Browse files
Merge branch 'propagate' of
https://git.cduce.org/cduce
into propagate
Conflicts: tests/lambda/src/compute.ml
parents
a780a8f4
8d1e1b2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/lambda/src/compute.ml
View file @
5ce3a562
...
...
@@ -13,6 +13,7 @@ let type_of_string s = match s with
|
"Char"
->
Builtin_defs
.
char
|
"Bool"
->
Builtin_defs
.
bool
|
"Any"
->
Builtin_defs
.
any
|
"Empty"
->
Types
.
empty
|
_
->
failwith
(
Printf
.
sprintf
"Type %s not recognized"
s
)
let
rec
_to_typed
env
l
expr
=
...
...
@@ -78,8 +79,7 @@ let rec _to_typed env l expr =
|
String
(
_
,
s
)
->
let
i
=
Big_int
.
big_int_of_int
0
in
let
s
=
Types
.
String
(
0
,
(
String
.
length
s
)
-
1
,
s
,
Types
.
Integer
i
)
in
env
,
l
,
{
exp_loc
=
loc
;
exp_typ
=
Builtin_defs
.
string
;
exp_descr
=
Cst
s
}
env
,
l
,
{
exp_loc
=
loc
;
exp_typ
=
Builtin_defs
.
string
;
exp_descr
=
Cst
s
}
|
Bool
(
origloc
,
b
)
->
let
t
=
Builtin_defs
.
true_type
in
let
f
=
Builtin_defs
.
false_type
in
...
...
@@ -87,7 +87,7 @@ let rec _to_typed env l expr =
|
"true"
->
env
,
l
,
{
exp_loc
=
loc
;
exp_typ
=
t
;
exp_descr
=
Cst
(
Types
.
Atom
(
Builtin_defs
.
true_atom
))
}
|
"false"
->
env
,
l
,
{
exp_loc
=
loc
;
exp_typ
=
f
;
exp_descr
=
Cst
(
Types
.
Atom
(
Builtin_defs
.
tru
e_atom
))
}
exp_descr
=
Cst
(
Types
.
Atom
(
Builtin_defs
.
fals
e_atom
))
}
|
_
->
let
line
=
Loc
.
start_line
origloc
in
let
cbegin
=
Loc
.
start_off
origloc
-
Loc
.
start_bol
origloc
in
...
...
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