xpeg::eos : Element(Element::TYPE_EOS);
End of Stream の略です。Streamの終端で1回だけmatchします。
単体で使うとStream終端で複数回matchします。scanとかで使うと無限ループします。
テキストファイルを1行ずつイテレートするサンプルです。最終行に改行が無くても表示します。
if (fs : FileStream("text.txt", "r")){ fs.scan(xpeg::eol|xpeg::eos){ it.prefix.p; } } else { "cannot open file".p; }
text file no 中身 desu