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:

  1. Parses the sign digit.
  2. Handles if positive signs before integers are not allowed.
  3. Handles negative signs if the type is unsigned.
  4. Handles if the sign is required, but missing.
  5. Handles if the iterator is empty, before or after parsing the sign.
  6. Handles if the iterator has invalid, leading zeros.

Returns if the value is negative, or any values detected when validating the input.