基本的にScannerは完成した。 テストはもっと必要だが、先へすすめてからのほうがいいだろう。 次にやらなければいけないことは... = Color-hightlight source code = Create node tree from scanned source code Bug tokenAddでidx_sとidxをPushしない場合、 tokenRevert($id);でもとには戻らない。 ---------------------------------------------------- $id=$this->tokenAdd(self::HPT_TEXT); if($this->parseTag()){ $this->tokenBegin($ch); continue; }else{ $this->tokenRevert($id); ---------------------------------------------------- idx_sとIdxは、tokenAddとは別に保存しなければいけない。 ---------------------------------------------------- $id=$this->tokenAdd(self::HPT_TEXT); // [BEGIN] save state $keep_idx_s=$this->idx_s; $keep_idx=$this->idx; // [END] save state if($this->parseTag()){ $this->tokenBegin($ch); continue; }else{ $this->tokenRevert($id); // [BEGIN] restore state $this->idx_s=$keep_idx_s; $this->idx=$keep_idx; // [END] restore state ----------------------------------------------------