(
&mut self,
s: S,
d: D,
expr: &Expr,
this_id: NodeID,
parent_id: NodeID,
)
| 1172 | } |
| 1173 | |
| 1174 | pub fn expr( |
| 1175 | &mut self, |
| 1176 | s: S, |
| 1177 | d: D, |
| 1178 | expr: &Expr, |
| 1179 | this_id: NodeID, |
| 1180 | parent_id: NodeID, |
| 1181 | ) -> io::Result<()> { |
| 1182 | match expr { |
| 1183 | Expr::Value { .. } => Ok(()), |
| 1184 | Expr::Name { .. } => Ok(()), |
| 1185 | Expr::Arg(name) => self.arg(s, d, this_id, parent_id, name), |
| 1186 | Expr::Repr { repr, span, args } => { |
| 1187 | self.repr(s, d, this_id, parent_id, repr, span, args) |
| 1188 | } |
| 1189 | Expr::FuncCall { name, span, .. } => { |
| 1190 | d.report(DiagnosticKind::UnrecognizedFunction(name.clone()), span); |
| 1191 | Ok(()) |
| 1192 | } |
| 1193 | Expr::UnOp { op, opr, .. } => self.un_op(s, d, this_id, parent_id, op, opr), |
| 1194 | Expr::BinOp { op, lhs, rhs, .. } => self.bin_op(s, d, this_id, parent_id, op, lhs, rhs), |
| 1195 | Expr::StructLiteral { name, span, .. } => { |
| 1196 | d.report( |
| 1197 | DiagnosticKind::TypeMismatch { |
| 1198 | expected: Type::Value, |
| 1199 | given: Type::Struct { |
| 1200 | name: name.clone(), |
| 1201 | span: span.clone(), |
| 1202 | }, |
| 1203 | }, |
| 1204 | &expr.span(), |
| 1205 | ); |
| 1206 | Ok(()) |
| 1207 | } |
| 1208 | Expr::Dot { lhs, rhs, rhs_span } => { |
| 1209 | self.expr_dot(s, d, this_id, parent_id, lhs, rhs, rhs_span.clone()) |
| 1210 | } |
| 1211 | } |
| 1212 | } |
| 1213 | } |
no test coverage detected