@@ -143,15 +143,7 @@ the existence of a block does not mean the block is pushed for that method.
143143It's possible that the block is pushed for the previous method. (Figure 1)
144144
145145
146- <div class="image">
147- <img src="images/ch_iterator_stacks.jpg" alt="(stacks)"><br>
148- Figure 1: no one-to-one correspondence between `FRAME` and `BLOCK`
149- * 上が先端 the end is above
150- * FRAMEに対応するBLOCKがあるか? Is there any BLOCK that corresponds to FRAME ?
151- * ある(けどイテレータではない) Yes. (But, this is not an iterator.)
152- * ある(本当にイテレータ) Yes. (this is actually an iterator.)
153- * ない No.
154- </div>
146+ !images/ch_iterator_stacks.jpg(no one-to-one correspondence between `FRAME` and `BLOCK`)!
155147
156148
157149So, in order to determine for which method the block is pushed, `ITER` is used.
@@ -289,13 +281,7 @@ At this moment, a method finally "becomes" an iterator.
289281Figure 2 shows the state of the stacks.
290282
291283
292- <div class="image">
293- <img src="images/ch_iterator_itertrans.jpg" alt="(itertrans)"><br>
294- Figure 2: the state of the Ruby stacks on an iterator call.
295- * 上が先端 the end is above
296- * イテレータか?(FRAMEに対応するITERがITER_CURか?)
297- Is this an iterator? (Is the ITER corresponds to FRAME ITER_CUR ?)
298- </div>
284+ !images/ch_iterator_itertrans.jpg(the state of the Ruby stacks on an iterator call.)!
299285
300286
301287The possible value of `ruby_iter` is not the one of two boolean values
@@ -508,11 +494,7 @@ but a new `FRAME` is created by duplicating.
508494This would look like Figure 3.
509495
510496
511- <div class="image">
512- <img src="images/ch_iterator_framepush.jpg" alt="(framepush)"><br>
513- Figure 3: push a copied frame
514- * コピーして作る creating by copying
515- </div>
497+ !images/ch_iterator_framepush.jpg(push a copied frame)!
516498
517499
518500As we've seen the code until here,
@@ -671,14 +653,7 @@ If we focus on there, we can see a link is always pushed in at the "next" to
671653`ruby_dyna_vars`. This means, it would look like Figure 4.
672654
673655
674- <div class="image">
675- <img src="images/ch_iterator_dynavarseval.jpg" alt="(dynavarseval)"><br>
676- Figure 4: the structure of `ruby_dyna_vars`
677- * ブロック起動時に(rb_yield_0で)追加 added (by using `rb_yield_0`) when invoking a block
678- * ブロック起動直後 immediately after invoking a block
679- * ブロック変数を追加 add block variables
680- * 追加された変数 added variables
681- </div>
656+ !images/ch_iterator_dynavarseval.jpg(the structure of `ruby_dyna_vars`)!
682657
683658
684659This differs from the case of the parser in one point:
@@ -690,11 +665,7 @@ a single straight link.
690665But according to the errata, it was wrong. That part and relevant descriptions
691666are removed.))
692667
693- <div class="image">
694- <img src="images/ch_iterator_insert.jpg" alt="(insert)"><br>
695- Figure 5: cannot properly insert an entry
696- * ここに挿入しないといけない must be inserted here
697- </div>
668+ !images/ch_iterator_insert.jpg(The entry cannot be inserted properly.)!
698669
699670
700671
@@ -804,11 +775,7 @@ Therefore, if `0x10` did not exist, `state` would be the same value as `TAG_xxxx
804775(See also Figure 6).
805776
806777
807- <div class="image">
808- <img src="images/ch_iterator_dst.jpg" alt="(dst)"><br>
809- Fig.6: <tt>block->tag->dst</tt>
810- * 常に1 always 1
811- </div>
778+ !images/ch_iterator_dst.jpg(`block->tag->dst`)!
812779
813780
814781Now, `tag->dst` became the value which differs from `TAG_xxxx` and is unique for each call.
@@ -1108,10 +1075,7 @@ In this way, one by one, the flag is propagated at the time when it pops.
11081075(Figure 7)
11091076
11101077
1111- <p class="image">
1112- <img src="images/ch_iterator_flaginfect.jpg" alt="(flaginfect)"><br>
1113- Figure 7: flag propagation
1114- </p>
1078+ !images/ch_iterator_dst.jpg(flag propagation)!
11151079
11161080
11171081Since `VARS` also does not have any `prev` pointer,
0 commit comments