TypeConstraints: update the type notation parser to avoid back-tracking
authorSam Vilain <sam.vilain@catalyst.net.nz>
Wed, 16 Dec 2009 22:23:34 +0000 (11:23 +1300)
committerDave Rolsky <autarch@urth.org>
Thu, 17 Dec 2009 20:24:04 +0000 (14:24 -0600)
commit68d5a469d9dad0c5507cebbe6f539840bb45828a
treef4a70572b3808bfe2b87fc27ee4a59a4d71fac13
parent43a376603d2bfc5f83f2ab5fb53f3a73706a6074
TypeConstraints: update the type notation parser to avoid back-tracking

The regex might be slow due to character-by-character back-tracking.
However, there are few if any abiguous forms here; it is almost LL(1), save
for the '$any' rule.  We can therefore limit backtracking by surrounding
all "tokens" in the 5.8+ (?>) independent sub-expression construct.
lib/Moose/Util/TypeConstraints.pm