# define Newx(v,n,t) New(0,v,n,t)
#endif /* !Newx */
-#if 1
-#define DD_HAS_TRAITS
-#endif
-
#if 0
#define DD_DEBUG
#endif
-#define DD_HANDLE_NAME 1
-#define DD_HANDLE_PROTO 2
-#define DD_HANDLE_PACKAGE 8
-
#ifdef DD_DEBUG
#define DD_DEBUG_S printf("Buffer: %s\n", s);
#else
/* callback thingy */
-void dd_linestr_callback (pTHX_ char* type, char* name, char* s) {
+void dd_linestr_callback (pTHX_ char* type, char* name) {
char* linestr = SvPVX(PL_linestr);
- int offset = s - linestr;
+ int offset = PL_bufptr - linestr;
dSP;
return HvNAME(PL_curstash);
}
-char* dd_move_past_token (pTHX_ char* s) {
+char* dd_move_past_token(pTHX_ char* s) {
/*
* buffer will be at the beginning of the declarator, -unless- the
return s;
}
-int dd_toke_move_past_token (pTHX_ int offset) {
+int dd_toke_move_past_token(pTHX_ int offset) {
char* base_s = SvPVX(PL_linestr) + offset;
char* s = dd_move_past_token(aTHX_ base_s);
return s - base_s;
STATIC OP *dd_ck_rv2cv(pTHX_ OP *o) {
OP* kid;
- char* s;
- char* save_s;
- char tmpbuf[sizeof PL_tokenbuf];
- char found_name[sizeof PL_tokenbuf];
- char* found_proto = NULL, *found_traits = NULL;
- STRLEN len = 0;
int dd_flags;
char* cb_args[6];
- dSP; /* define stack pointer for later call stuff */
- char* retstr;
- STRLEN n_a; /* for POPpx */
o = dd_old_ck_rv2cv(aTHX_ o); /* let the original do its job */
if (in_declare) {
- cb_args[0] = NULL;
-#ifdef DD_DEBUG
- printf("Deconstructing declare\n");
- printf("PL_bufptr: %s\n", PL_bufptr);
- printf("bufend at: %i\n", PL_bufend - PL_bufptr);
- printf("linestr: %s\n", SvPVX(PL_linestr));
- printf("linestr len: %i\n", PL_bufend - SvPVX(PL_linestr));
-#endif
- call_argv("Devel::Declare::done_declare", G_VOID|G_DISCARD, cb_args);
+ dSP;
+ PUSHMARK(SP);
+ call_pv("Devel::Declare::done_declare", G_VOID|G_DISCARD);
in_declare--;
-#ifdef DD_DEBUG
- printf("PL_bufptr: %s\n", PL_bufptr);
- printf("bufend at: %i\n", PL_bufend - PL_bufptr);
- printf("linestr: %s\n", SvPVX(PL_linestr));
- printf("linestr len: %i\n", PL_bufend - SvPVX(PL_linestr));
- printf("actual len: %i\n", strlen(PL_bufptr));
-#endif
return o;
}
if (PL_lex_state != LEX_NORMAL && PL_lex_state != LEX_INTERPNORMAL)
return o; /* not lexing? */
- /* I was doing this, but the CONST wrap can't so it didn't gain anything
- stash = GvSTASH(kGVOP_gv); */
-
-#ifdef DD_DEBUG
- printf("Checking GV %s -> %s\n", HvNAME(GvSTASH(kGVOP_gv)), GvNAME(kGVOP_gv));
-#endif
-
dd_flags = dd_is_declarator(aTHX_ GvNAME(kGVOP_gv));
if (dd_flags == -1)
return o;
-#ifdef DD_DEBUG
- printf("dd_flags are: %i\n", dd_flags);
-#endif
-
- s = PL_bufptr; /* copy the current buffer pointer */
-
- DD_DEBUG_S
-
-#ifdef DD_DEBUG
- printf("PL_tokenbuf: %s\n", PL_tokenbuf);
-#endif
-
- dd_linestr_callback(aTHX_ "rv2cv", GvNAME(kGVOP_gv), s);
+ dd_linestr_callback(aTHX_ "rv2cv", GvNAME(kGVOP_gv));
return o;
}
if (dd_flags == -1)
return o;
- s = PL_bufptr;
-
- dd_linestr_callback(aTHX_ "const", name, s);
+ dd_linestr_callback(aTHX_ "const", name);
return o;
}