Magic vars for repeaters

This adds a few magic pattern vars that can only be referenced in
repeaters: `$$index`, `$$index1` (plus 1), and `$$length`.