[Bast-commits] r4953 - in Devel-Declare/1.000/branches/hook_parser:
. lib/Devel
rafl at dev.catalyst.perl.org
rafl at dev.catalyst.perl.org
Wed Oct 22 19:41:56 BST 2008
Author: rafl
Date: 2008-10-22 19:41:56 +0100 (Wed, 22 Oct 2008)
New Revision: 4953
Modified:
Devel-Declare/1.000/branches/hook_parser/Declare.xs
Devel-Declare/1.000/branches/hook_parser/Makefile.PL
Devel-Declare/1.000/branches/hook_parser/lib/Devel/Declare.pm
Log:
Port to B::Hooks::Parser.
Modified: Devel-Declare/1.000/branches/hook_parser/Declare.xs
===================================================================
--- Devel-Declare/1.000/branches/hook_parser/Declare.xs 2008-10-22 18:40:26 UTC (rev 4952)
+++ Devel-Declare/1.000/branches/hook_parser/Declare.xs 2008-10-22 18:41:56 UTC (rev 4953)
@@ -106,29 +106,6 @@
LEAVE;
}
-char* dd_get_linestr(pTHX) {
- if (!DD_HAVE_PARSER) {
- return NULL;
- }
- return SvPVX(PL_linestr);
-}
-
-void dd_set_linestr(pTHX_ char* new_value) {
- int new_len = strlen(new_value);
-
- if (SvLEN(PL_linestr) < new_len) {
- croak("forced to realloc PL_linestr for line %s, bailing out before we crash harder", SvPVX(PL_linestr));
- }
-
- SvGROW(PL_linestr, new_len);
-
- memcpy(SvPVX(PL_linestr), new_value, new_len+1);
-
- SvCUR_set(PL_linestr, new_len);
-
- PL_bufend = SvPVX(PL_linestr) + new_len;
-}
-
char* dd_get_lex_stuff(pTHX) {
return (DD_HAVE_LEX_STUFF ? SvPVX(PL_lex_stuff) : "");
}
@@ -142,15 +119,6 @@
return HvNAME(PL_curstash);
}
-int dd_get_linestr_offset(pTHX) {
- char* linestr;
- if (!DD_HAVE_PARSER) {
- return -1;
- }
- linestr = SvPVX(PL_linestr);
- return PL_bufptr - linestr;
-}
-
char* dd_move_past_token (pTHX_ char* s) {
/*
@@ -336,18 +304,6 @@
filter_add(dd_filter_realloc, NULL);
char*
-get_linestr()
- CODE:
- RETVAL = dd_get_linestr(aTHX);
- OUTPUT:
- RETVAL
-
-void
-set_linestr(char* new_value)
- CODE:
- dd_set_linestr(aTHX_ new_value);
-
-char*
get_lex_stuff()
CODE:
RETVAL = dd_get_lex_stuff(aTHX);
@@ -367,13 +323,6 @@
RETVAL
int
-get_linestr_offset()
- CODE:
- RETVAL = dd_get_linestr_offset(aTHX);
- OUTPUT:
- RETVAL
-
-int
toke_scan_word(int offset, int handle_package)
CODE:
RETVAL = dd_toke_scan_word(aTHX_ offset, handle_package);
Modified: Devel-Declare/1.000/branches/hook_parser/Makefile.PL
===================================================================
--- Devel-Declare/1.000/branches/hook_parser/Makefile.PL 2008-10-22 18:40:26 UTC (rev 4952)
+++ Devel-Declare/1.000/branches/hook_parser/Makefile.PL 2008-10-22 18:41:56 UTC (rev 4953)
@@ -9,9 +9,12 @@
requires 'Scalar::Util';
requires 'B::Hooks::OP::Check' => '0.10';
+requires 'B::Hooks::Parser';
build_requires 'B::Hooks::OP::Check' => '0.10';
+build_requires 'B::Hooks::Parser';
configure_requires 'ExtUtils::Depends';
configure_requires 'B::Hooks::OP::Check' => '0.10';
+configure_requires 'B::Hooks::Parser';
test_requires 'Test::More';
test_requires 'B::Hooks::EndOfScope';
@@ -19,7 +22,7 @@
$(OBJECT) : stolen_chunk_of_toke.c
EOM
-my $pkg = ExtUtils::Depends->new('Devel::Declare', 'B::Hooks::OP::Check');
+my $pkg = ExtUtils::Depends->new('Devel::Declare', 'B::Hooks::OP::Check', 'B::Hooks::Parser');
WriteMakefile(
dist => {
Modified: Devel-Declare/1.000/branches/hook_parser/lib/Devel/Declare.pm
===================================================================
--- Devel-Declare/1.000/branches/hook_parser/lib/Devel/Declare.pm 2008-10-22 18:40:26 UTC (rev 4952)
+++ Devel-Declare/1.000/branches/hook_parser/lib/Devel/Declare.pm 2008-10-22 18:41:56 UTC (rev 4953)
@@ -15,11 +15,20 @@
use base qw(DynaLoader);
use Scalar::Util 'set_prototype';
use B::Hooks::OP::Check;
+use B::Hooks::Parser;
bootstrap Devel::Declare;
@ISA = ();
+# temporary backcompat
+{
+ for (qw/get_linestr get_linestr_offset set_linestr/) {
+ no strict 'refs';
+ *{ $_ } = B::Hooks::Parser->can($_);
+ }
+}
+
sub import {
my ($class, %args) = @_;
my $target = caller;
More information about the Bast-commits
mailing list