Join GitHub today
Allow function attributes to come before the signature/prototype #127
Attempts to resolve #99 by overriding two method in Devel::Declare that prevented this from working before. D::D's base parser expects to see a function-like declaration in this order
Without these overridden methods, Devel::Declare's strip_attrs() gets stuck in an endless loop looking for the open brace after finding and removing the attributes. The current offset advances to the open paren starting the signature, and then never advances further. The overridden strip_attrs() is just a copy of D::D::Context::Simple::strip_attrs() that terminates the loop if it finds
D::D's strip_proto() will never find the signature if the attribtes are earlier and still in the parse buffer. So the overridden parser() method looks to see whether
I'm not happy with all the copied code from Devel::Declare... Maybe it would be better to patch Devel::Declare with these changes, or at least add hooks in D::D we can use here.