Skip to content
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

Integers and float regexps #7

Open
Drup opened this issue Apr 27, 2015 · 0 comments
Open

Integers and float regexps #7

Drup opened this issue Apr 27, 2015 · 0 comments

Comments

@Drup
Copy link
Owner

Drup commented Apr 27, 2015

The regexp for float and ints accept arbitrary big numbers and then parses them. If it's too big, it will fail (and not gracefully, at the moment)

I'm not sure what would be a good solution.

  • Using a regexp that matches only 32 bit integers, while possible, is a terrible idea.
  • Using zarith is a bit overkill (most application really don't care). And there is the javascript issue.
  • Wrapping int and floats in an option is really not user friendly.

The only good solution I see is to

  • Return None for extract. It forces the return type of extract to be an option (which should be the case anyway, but the types are not obvious to me just yet)
  • Trigger the default handler for match_url.

Maybe the kind of error encountered should be exposed to the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant