parse.y
parse.yの中には、Ruby本体の処理とRipperでの処理の両方が書かれている。例えば以下のように、/*%%%*/から/*%の間がRubyの処理で、/*%から%*/までがRipperの処理である。
| kMODULE cpath { /*%%%*/ if (in_def || in_single) yyerror("module definition in method body"); class_nest++; local_push(0); $<num>$ = ruby_sourceline; /*% if (in_def || in_single) yyerror("module definition in method body"); class_nest++; %*/ }
上記のように、両方に同じ処理が含まれている場合に、重複して書いているのは何か理由があるのだろうか?同じ部分を外に出して問題がなければ、そうすべきではないだろうか。