Parses an assignment to the array `varref` with `subscripts`, both of which have already been read.
(
&mut self,
vref: VarRef,
vref_pos: LineCol,
subscripts: Vec<Expr>,
)
| 333 | /// Parses an assignment to the array `varref` with `subscripts`, both of which have already |
| 334 | /// been read. |
| 335 | fn parse_array_assignment( |
| 336 | &mut self, |
| 337 | vref: VarRef, |
| 338 | vref_pos: LineCol, |
| 339 | subscripts: Vec<Expr>, |
| 340 | ) -> Result<Statement> { |
| 341 | let expr = self.parse_required_expr("Missing expression in array assignment")?; |
| 342 | |
| 343 | let next = self.lexer.peek()?; |
| 344 | match &next.token { |
| 345 | Token::Eof | Token::Eol | Token::Else => (), |
| 346 | t => return Err(Error::Bad(next.pos, format!("Unexpected {} in array assignment", t))), |
| 347 | } |
| 348 | Ok(Statement::ArrayAssignment(ArrayAssignmentSpan { vref, vref_pos, subscripts, expr })) |
| 349 | } |
| 350 | |
| 351 | /// Parses a builtin call (things of the form `INPUT a`). |
| 352 | fn parse_builtin_call( |
no test coverage detected