-
Notifications
You must be signed in to change notification settings - Fork 0
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
Robust position parser #11
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #11 +/- ##
==========================================
+ Coverage 90.66% 91.77% +1.11%
==========================================
Files 6 7 +1
Lines 857 961 +104
==========================================
+ Hits 777 882 +105
+ Misses 80 79 -1 ☔ View full report in Codecov by Sentry. |
265cd3d
to
f96e5fa
Compare
f96e5fa
to
94ca038
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
取り急ぎ
EmptyRange, | ||
} | ||
|
||
pub fn estimate_position(input_pattern: &str) -> Result<(AllPosition, &str), PositionError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactor……
letの初期化式が長くなってるのをそれぞれ関数に切り出す?
0cbd3b1
to
dd686e2
Compare
0a8330e
to
aeee738
Compare
split.match_position()
はAllPositionを一意に決定し(もし複数の候補が残ればエラーを返します),split.verify(position)
はそれが既知のパターンに矛盾しないことを確認します.したがって,パターンに記述された条件が不十分で一つに決定できない場合は
match_position
,位置は一意に推定できるものの,文法が間違っていてマッチしないものはverify
でエラーになります.なお,
estimate_position
がOk
を返したとしても,range
が有効であること,及びrange
が有効に対象の範囲を絞り込めることは保証しません.例えば,*/B:?*
は全くの無意味ですが,estimate_position
はOk
を返します.