-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DSL for module semantics #32
Changes from 3 commits
152b2d0
a1c51f9
5380d76
2b82dcc
6b6bd32
835bf0d
7d757da
7aaff60
cecacb5
2a158db
066f8c3
6c7d379
97d3fe6
68c6067
b8681db
9b3e6e3
030a3a8
d967107
8f6c590
0f48772
35be3dd
edda75e
ff216fb
21e0a94
236de04
1560490
e7a5252
6bc75a6
506306e
eb57512
5aeb393
a453c69
88fe94b
42b276f
65e6777
edb1fbf
8bb5fe0
6872abe
616eded
d764e97
5c9aed2
ba5b056
31213dd
474c65f
384016d
fd8ec1f
97e95c3
0e45bef
199efd1
cb45bce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -336,7 +336,7 @@ let rec elab_iter env iter : Il.iter = | |
| Opt -> Il.Opt | ||
| List -> Il.List | ||
| List1 -> Il.List1 | ||
| ListN (e, opt) -> Il.ListN (elab_exp env e (NatT $ e.at), opt) | ||
| ListN (e, id_opt) -> Il.ListN (elab_exp env e (NatT $ e.at), id_opt) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This also needs to check the type of the id. |
||
|
||
|
||
(* Types *) | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -68,7 +68,8 @@ let iter_nl_list f xs = List.iter (function Nl -> () | Elem x -> f x) xs | |||||||||||||||||||||||||||
let rec check_iter env ctx iter = | ||||||||||||||||||||||||||||
match iter with | ||||||||||||||||||||||||||||
| Opt | List | List1 -> () | ||||||||||||||||||||||||||||
| ListN (e, _) -> | ||||||||||||||||||||||||||||
| ListN (e, opt) -> | ||||||||||||||||||||||||||||
Option.iter (fun id -> check_id env (iter::ctx) id) opt; | ||||||||||||||||||||||||||||
check_exp env ctx e | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
and check_exp env ctx e = | ||||||||||||||||||||||||||||
|
@@ -162,9 +163,13 @@ let union = Env.union (fun _ ctx1 ctx2 -> assert (ctx1 = ctx2); Some ctx1) | |||||||||||||||||||||||||||
let rec annot_iter env iter : Il.Ast.iter * occur = | ||||||||||||||||||||||||||||
match iter with | ||||||||||||||||||||||||||||
| Opt | List | List1 -> iter, Env.empty | ||||||||||||||||||||||||||||
| ListN (e, opt) -> | ||||||||||||||||||||||||||||
| ListN (e, None) -> | ||||||||||||||||||||||||||||
let e', occur = annot_exp env e in | ||||||||||||||||||||||||||||
ListN (e', opt), occur | ||||||||||||||||||||||||||||
ListN (e', None), occur | ||||||||||||||||||||||||||||
| ListN (e, Some id) -> | ||||||||||||||||||||||||||||
let e', occur1 = annot_exp env e in | ||||||||||||||||||||||||||||
let occur2 = Env.singleton id.it [] in | ||||||||||||||||||||||||||||
ListN (e', Some id), union occur1 occur2 | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
and annot_exp env e : Il.Ast.exp * occur = | ||||||||||||||||||||||||||||
let it, occur = | ||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed this nit before: