-_BINARY32_MATCHER = re.compile(r'(-?\d+\.\d+)f')
-_BINARY64_MATCHER = re.compile(r'(-?\d+\.\d+)d')
-
-@_consume_leading_whitespace
-def _binary32_parser(s):
- match = _BINARY32_MATCHER.match(s)
-
- if match:
- # TODO Validate that the float is in range
- return _shared.ParseResult(
- success = True,
- value = float(match.group(1)),
- remaining = s[match.end():],
- )
-
- return _shared._FAILED_PARSE_RESULT
-
-@_consume_leading_whitespace
-def _binary64_parser(s):
- match = _BINARY64_MATCHER.match(s)
-
- if match:
- # TODO Validate that the double is in range
- return _shared.ParseResult(
- success = True,
- value = float(match.group(1)),
- remaining = s[match.end():],
- )
-
- return _shared._FAILED_PARSE_RESULT
-