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
1c8eaf3c
Commit
1c8eaf3c
authored
Aug 19, 2014
by
Pietro Abate
Browse files
TVar is of type U.t
parent
36e1499d
Changes
3
Hide whitespace changes
Inline
Side-by-side
parser/ast.ml
View file @
1c8eaf3c
...
...
@@ -105,7 +105,7 @@ and branches = (ppat * pexpr) list
and
ppat
=
ppat'
located
and
ppat'
=
|
TVar
of
string
(** polymorphic type variables *)
|
TVar
of
U
.
t
(** polymorphic type variables *)
|
PatVar
of
U
.
t
list
|
Cst
of
pexpr
|
NsT
of
U
.
t
...
...
parser/parser.ml
View file @
1c8eaf3c
...
...
@@ -606,7 +606,7 @@ EXTEND Gram
|
"no_arrow"
[
x
=
pat
;
"|"
;
y
=
pat
->
mk
_loc
(
Or
(
x
,
y
))
]
|
"simple"
[
x
=
pat
;
"&"
;
y
=
pat
->
mk
_loc
(
And
(
x
,
y
))
|
x
=
pat
;
"
\\
"
;
y
=
pat
->
mk
_loc
(
Diff
(
x
,
y
))
]
|
"var_typ"
[
x
=
PTYPE
->
mk
_loc
(
TVar
x
)
]
|
"var_typ"
[
x
=
PTYPE
->
mk
_loc
(
TVar
(
ident
x
)
)
]
|
[
"{"
;
r
=
record_spec
;
"}"
->
r
|
"ref"
;
p
=
pat
->
...
...
@@ -621,7 +621,7 @@ EXTEND Gram
|
"!"
;
a
=
IDENT
->
mk
_loc
(
Internal
(
Types
.
abstract
(
Types
.
Abstracts
.
atom
a
)))
|
ids
=
LIST1
ident_or_keyword
SEP
"."
->
let
ids
=
List
.
map
(
fun
x
->
ident
x
)
ids
in
let
ids
=
List
.
map
ident
ids
in
mk
_loc
(
PatVar
ids
)
|
i
=
INT
;
"--"
;
j
=
INT
->
let
i
=
Intervals
.
V
.
mk
i
...
...
typing/typer.ml
View file @
1c8eaf3c
...
...
@@ -325,9 +325,10 @@ module IType = struct
all_delayed
:=
[]
;
List
.
iter
check_one_delayed
l
(* Ast -> symbolic type *)
let
rec
derecurs
env
p
=
match
p
.
descr
with
|
TVar
s
->
mk_type
(
Types
.
var
(
Var
.
mk
s
))
|
TVar
s
->
mk_type
(
Types
.
var
(
Var
.
mk
(
U
.
to_string
s
)
))
|
PatVar
ids
->
derecurs_var
env
p
.
loc
ids
|
Recurs
(
p
,
b
)
->
derecurs
(
fst
(
derecurs_def
env
b
))
p
|
Internal
t
->
mk_type
t
...
...
@@ -478,7 +479,10 @@ type branch = Branch of Typed.branch * branch list
let
cur_branch
:
branch
list
ref
=
ref
[]
let
exp'
loc
e
=
{
Typed
.
exp_loc
=
loc
;
Typed
.
exp_typ
=
Types
.
empty
;
Typed
.
exp_descr
=
e
}
{
Typed
.
exp_loc
=
loc
;
Typed
.
exp_typ
=
Types
.
empty
;
Typed
.
exp_descr
=
e
}
let
exp
loc
fv
e
=
fv
,
exp'
loc
e
...
...
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