Skip to content

Commit

Permalink
[ fix #43 ] Desugar: projections DONE
Browse files Browse the repository at this point in the history
  • Loading branch information
ice1000 committed Oct 13, 2019
1 parent f3242df commit cec0223
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
+ Unfolds data and codata applications (#27)
+ Parsing (expr parsing and file parsing) (#20, #31)
+ `Abs::App` is now chained (#33)
+ Desugar surface into abstract, scope check (#36, #42)
+ Desugar surface into abstract, scope check (#36, #42, #43)

# 0.0.3

Expand Down
7 changes: 6 additions & 1 deletion src/syntax/abs/desugar/decls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,12 @@ pub fn desugar_decl(state: DesugarState, decl: ExprDecl) -> DesugarM {
let codata = AbsDecl::codata(loc, name, None, Default::default(), tele, fields_ices);
state.decls.push(codata);
for field in fields {
unimplemented!()
let (abs, new_st) = desugar_expr(state, field.expr)?;
state = new_st;
let name = field.label;
let loc = name.loc + abs.loc();
let proj = AbsDecl::field(loc, name, abs, GI(codata_ix));
state.decls.push(proj);
}
Ok(state)
}
Expand Down

0 comments on commit cec0223

Please sign in to comment.