From: mauke Date: Sun, 14 Oct 2012 12:44:05 +0000 (+0200) Subject: fix wrong line number for statement immediately following a function X-Git-Tag: v0.09~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5efe0e0e06ece6261b34fc19b6153e3fa13ea3c6;p=p5sagit%2FFunction-Parameters.git fix wrong line number for statement immediately following a function --- diff --git a/Changes b/Changes index c5c40f6..9a2172e 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Revision history for Function-Parameters +0.09 2012-10-14 + - fix wrong line number for statement immediately following a function + 0.08 2012-07-19 - support UTF-8 in function/parameter names - better detection of invalid prototypes diff --git a/Parameters.xs b/Parameters.xs index bb30693..30502f2 100644 --- a/Parameters.xs +++ b/Parameters.xs @@ -886,7 +886,7 @@ static int parse_fun(pTHX_ OP **pop, const char *keyword_ptr, STRLEN keyword_len attrs, body ); - *pop = NULL; + *pop = newOP(OP_NULL, 0); return KEYWORD_PLUGIN_STMT; } } diff --git a/t/lineno.t b/t/lineno.t index 578570d..279c324 100644 --- a/t/lineno.t +++ b/t/lineno.t @@ -1,7 +1,7 @@ use warnings; use strict; -use Test::More tests => 10; +use Test::More tests => 11; use Function::Parameters; @@ -69,6 +69,7 @@ test_loc 'LX -- 3'; : { test_loc 'LX -- 5 (inner)' } + test_loc 'LX -- 5 (bonus)'; wtf; test_loc 'LX -- 5 (outer)'; }