Macro lexical_parse_integer::parse_sign
source ยท macro_rules! parse_sign { ( $byte:ident, $is_signed:expr, $no_positive:expr, $required:expr, $invalid_positive:ident, $missing:ident ) => { ... }; }
Expand description
Parse the sign from the leading digits.
This routine does the following:
- Parses the sign digit.
- Handles if positive signs before integers are not allowed.
- Handles negative signs if the type is unsigned.
- Handles if the sign is required, but missing.
- Handles if the iterator is empty, before or after parsing the sign.
- Handles if the iterator has invalid, leading zeros.
Returns if the value is negative, or any values detected when validating the input.