Parse theorem declaration
(&mut self)
| 100 | |
| 101 | /// Parse theorem declaration |
| 102 | fn parse_theorem(&mut self) -> crate::Result<TheoremDecl> { |
| 103 | let start = self.expect(TokenKind::Theorem)?.span; |
| 104 | |
| 105 | let name = self.parse_ident()?; |
| 106 | let universe_params = self.parse_universe_params()?; |
| 107 | let params = self.parse_params()?; |
| 108 | |
| 109 | self.expect(TokenKind::Colon)?; |
| 110 | let type_ = Box::new(self.parse_expr()?); |
| 111 | |
| 112 | self.expect(TokenKind::ColonEq)?; |
| 113 | let proof = Box::new(self.parse_expr()?); |
| 114 | |
| 115 | let end = proof.span(); |
| 116 | |
| 117 | Ok(TheoremDecl { |
| 118 | span: start.to(end), |
| 119 | name, |
| 120 | universe_params, |
| 121 | params, |
| 122 | type_, |
| 123 | proof, |
| 124 | }) |
| 125 | } |
| 126 | |
| 127 | /// Parse axiom declaration |
| 128 | fn parse_axiom(&mut self) -> crate::Result<AxiomDecl> { |
no test coverage detected