Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

command_patternがPreprocessorで数式展開する前のコマンドに利用できない #412

Open
blhsrwznrghfzpr opened this issue Apr 7, 2021 · 1 comment
Assignees

Comments

@blhsrwznrghfzpr
Copy link
Contributor

command_pattern

応答するコマンド全てにマッチする正規表現を返す
正規表現を一度生成したら、以後コマンドの登録はできないようにする
https://yard.bcdice.org/BCDice/Base.html#command_pattern-class_method

command_patternはBCDiceで処理できるかもしれないコマンドかどうかを、
外部のツールから判定するために用意されている正規表現だと認識しています。

が、システム固有のコマンドの一部に対しては、Preprocessorによって処理された後のパターンしか登録されていません。
そのため、Preprocessorで処理(括弧数式展開)される前のコマンドがcommand_patternにマッチしないことがあります。
例としては下記のようなものなどです

register_prefix('IP\d+')
input = "IP(1+2)"

調査のために下記のような変更を入れてみたところ、現状では4システムが発見できます。
blhsrwznrghfzpr@d7fee31
テストケースに書かれていないものも含めるともっと多いかと思います。

  • AceKillerGene
  • Chill
  • GardenOrder
  • ScreamHighSchool

command_patternPreprocessorで前処理する前のコマンドに対しても利用できるように強制するようなテストなどを用意できたりしないでしょうか?

@ysakasin ysakasin self-assigned this Apr 7, 2021
@ysakasin
Copy link
Member

ysakasin commented Apr 7, 2021

ありがとうございます。 command_pattern の活用にはこの問題の解決が必須だと思うので、まずは何をゴールとするか考えてみます。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants