User blog comment:Hyp cos/R function II/@comment-5529393-20150406080531/@comment-11227630-20150406081530

There're 3 kinds of things we scan - 0, non-0 numbers and braces not a separator.

What you scan is a whole brace, not a simple lbrace symbol. So you first scan to the whole brace {{0,2},2}, by case C, A_2 = {{0,2},2}; then you scan to the whole brace {0,2}, by case C, A_3 = {0,2}; then you scan to the 0, by case A4, continue scanning; then you scan to the 2, by case B3, the {0,2} become {0,1,1}, A_4 = comma; then you scan inside the comma (i.e. {0+1}), you scan to the 0, now s=4, and you start apply case A3.