On 15 June 2014 18:09, Tal Einat <talei...@gmail.com> wrote:
>
> More importantly, how will you give informative error messages if the
> regexp fails? For example, how will you tell the difference between a
> missing '>', an invalid modifier, and a missing detail? That's the
> downside with a regexp - it either matches or doesn't, and if not you
> can't tell why.
>

As you can see in the above link, simple cases like missing '<' at
start, repeated modifier, missing '>' at end, errors with appropriate
messages are raised.

I now updated the diff file at
https://gist.github.com/sahutd/289d2297eb83a020a6dd.
It can now ascertain which part of (whether modifier, type or detail)
is invalid.
It can also say why it is invalid(Not all reasons are covered ATM,
though it can be done quite easily. Just a matter of checking for that
condition and adding a suitable error message).
See the tests in the same diff for an example.


-- 
Regards
Saimadhav Heblikar
_______________________________________________
IDLE-dev mailing list
IDLE-dev@python.org
https://mail.python.org/mailman/listinfo/idle-dev

Reply via email to