From: Florian Ragwitz Date: Tue, 11 Aug 2009 20:00:59 +0000 (+0200) Subject: Don't invoke the linestr callback if we found a keyword and the bufptr still contains... X-Git-Tag: 0.005010~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=954da33291094e62b3712a4ce0d1d138f8fdbd6d;p=p5sagit%2FDevel-Declare.git Don't invoke the linestr callback if we found a keyword and the bufptr still contains an arrow at its beginning. This means we're about to compile a method invocation, the tokenizer forced parsing a word, and we got the const op of that. I'm not too happy with this. I see how it can be useful to hook into those places, but it should probably be a different feature of DD. --- diff --git a/Declare.xs b/Declare.xs index 95dd495..500e9d7 100644 --- a/Declare.xs +++ b/Declare.xs @@ -381,6 +381,10 @@ STATIC OP *dd_ck_const(pTHX_ OP *o, void *user_data) { break; } + if (strnEQ (PL_bufptr, "->", 2)) { + return o; + } + dd_linestr_callback(aTHX_ "const", name); return o;