mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 22:32:33 +00:00
refactor(UsageParser) Make the functions passed to .stop_at() straightforward
This commit is contained in:
parent
1d6a7c6e7e
commit
bb1fa0d694
1 changed files with 4 additions and 9 deletions
|
@ -197,27 +197,22 @@ impl<'a> UsageParser<'a> {
|
|||
|
||||
#[inline]
|
||||
fn name_end(b: u8) -> bool {
|
||||
// 93(]), 62(>)
|
||||
b > b']' || b < b'>' || (b > b'>' && b < b']')
|
||||
b != b']' && b != b'>'
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn token(b: u8) -> bool {
|
||||
// 39('), 45(-), 46(.), 60(<), 91([)
|
||||
b < 39 || b > 91 || (b > 46 && b < 91 && b != b'<') || (b > 39 && b < 45)
|
||||
b != b'\'' && b != b'.' && b != b'<' && b != b'[' && b != b'-'
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn long_end(b: u8) -> bool {
|
||||
// 39('), 46(.), 60(<), 61(=), 91([), 32( )
|
||||
(b < 39 && (b > 13 && b != b' ')) || b > 91 || (b > 61 && b < 91) ||
|
||||
(b > 39 && b < 60 && b != 46)
|
||||
b != b'\'' && b != b'.' && b != b'<' && b != b'[' && b != b'=' && b != b' '
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn help_start(b: u8) -> bool {
|
||||
// 39(')
|
||||
b < 39 || b > 39
|
||||
b != b'\''
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
Loading…
Reference in a new issue