(&mut self, ctx: &IndexContext<'_>)
| 779 | } |
| 780 | |
| 781 | fn visit_Index(&mut self, ctx: &IndexContext<'_>) -> Self::Return { |
| 782 | if let (Some(member), Some(index)) = (&ctx.member(), &ctx.index) { |
| 783 | let target = self.visit(member.as_ref()); |
| 784 | match &ctx.op { |
| 785 | None => self.report_error::<ParseError, _>(&ctx.start(), None, "No `Index`!"), |
| 786 | Some(op) => { |
| 787 | let op_id = self.helper.next_id(op); |
| 788 | let index = self.visit(index.as_ref()); |
| 789 | if let Some(_opt) = &ctx.opt { |
| 790 | return if self.enable_optional_syntax { |
| 791 | self.global_call_or_macro( |
| 792 | op_id, |
| 793 | operators::OPT_INDEX.to_string(), |
| 794 | vec![target, index], |
| 795 | ) |
| 796 | } else { |
| 797 | self.report_error::<ParseError, _>( |
| 798 | op.as_ref(), |
| 799 | None, |
| 800 | "unsupported syntax '[?'", |
| 801 | ) |
| 802 | }; |
| 803 | } |
| 804 | self.global_call_or_macro( |
| 805 | op_id, |
| 806 | operators::INDEX.to_string(), |
| 807 | vec![target, index], |
| 808 | ) |
| 809 | } |
| 810 | } |
| 811 | } else { |
| 812 | self.report_error::<ParseError, _>(&ctx.start(), None, "Incomplete `IndexContext`!") |
| 813 | } |
| 814 | } |
| 815 | |
| 816 | fn visit_Ident(&mut self, ctx: &IdentContext<'_>) -> Self::Return { |
| 817 | match &ctx.id { |
nothing calls this directly
no test coverage detected