From: Florian Ragwitz Date: Fri, 7 Nov 2008 06:51:40 +0000 (+0000) Subject: Expose scan_ident to perl space. X-Git-Tag: 0.005000~30 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f11d21b25ceebe4df4bbc27f189302a952d2acc6;p=p5sagit%2FDevel-Declare.git Expose scan_ident to perl space. --- diff --git a/Declare.xs b/Declare.xs index 635d946..99124d0 100644 --- a/Declare.xs +++ b/Declare.xs @@ -179,6 +179,14 @@ int dd_toke_scan_word(pTHX_ int offset, int handle_package) { return s - base_s; } +int dd_toke_scan_ident(pTHX_ int offset) { + char tmpbuf[sizeof PL_tokenbuf]; + char* base_s = SvPVX(PL_linestr) + offset; + STRLEN len; + char* s = scan_ident(base_s, PL_bufend, tmpbuf, sizeof tmpbuf, 0); + return s - base_s; +} + int dd_toke_scan_str(pTHX_ int offset) { char* base_s = SvPVX(PL_linestr) + offset; char* s = scan_str(base_s, FALSE, FALSE); @@ -406,6 +414,13 @@ toke_scan_str(int offset); RETVAL int +toke_scan_ident(int offset) + CODE: + RETVAL = dd_toke_scan_ident(aTHX_ offset); + OUTPUT: + RETVAL + +int toke_skipspace(int offset) CODE: RETVAL = dd_toke_skipspace(aTHX_ offset);