diff options
author | Zefram <zefram@fysh.org> | 2010-08-15 21:36:11 +0100 |
---|---|---|
committer | Florian Ragwitz <rafl@debian.org> | 2010-08-22 05:19:34 +0200 |
commit | 510966aa601964fcdb06b3cdf4dc8e1241107f1a (patch) | |
tree | 8918cb445f033514697f2ab02e0e405373b33c75 | |
parent | ae5391ad3eac034928d0ad9aeb57e8d9f625142f (diff) | |
download | perl-510966aa601964fcdb06b3cdf4dc8e1241107f1a.tar.gz |
add lex_stuff_pvs()
New macro lex_stuff_pvs(), wrapping lex_stuff_pvn() for literal strings.
-rw-r--r-- | ext/XS-APItest-KeywordRPN/KeywordRPN.xs | 2 | ||||
-rw-r--r-- | handy.h | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/ext/XS-APItest-KeywordRPN/KeywordRPN.xs b/ext/XS-APItest-KeywordRPN/KeywordRPN.xs index adb7e6b7bc..a5dfcd9adc 100644 --- a/ext/XS-APItest-KeywordRPN/KeywordRPN.xs +++ b/ext/XS-APItest-KeywordRPN/KeywordRPN.xs @@ -166,7 +166,7 @@ static OP *THX_parse_keyword_stufftest(pTHX) } else if(c != /*{*/'}') { croak("syntax error"); } - if(do_stuff) lex_stuff_pvn(" ", 1, 0); + if(do_stuff) lex_stuff_pvs(" ", 0); return newOP(OP_NULL, 0); } #define parse_keyword_stufftest() THX_parse_keyword_stufftest(aTHX) @@ -314,6 +314,13 @@ Like C<hv_fetch>, but takes a literal string instead of a string/length pair. Like C<hv_store>, but takes a literal string instead of a string/length pair and omits the hash parameter. +=head1 Lexer interface + +=for apidoc Amx|void|lex_stuff_pvs|const char *pv|U32 flags + +Like L</lex_stuff_pvn>, but takes a literal string instead of a +string/length pair. + =cut */ @@ -344,6 +351,8 @@ and omits the hash parameter. ((SV **)Perl_hv_common(aTHX_ (hv), NULL, STR_WITH_LEN(key), 0, \ (HV_FETCH_ISSTORE|HV_FETCH_JUST_SV), (val), 0)) +#define lex_stuff_pvs(pv,flags) Perl_lex_stuff_pvn(aTHX_ STR_WITH_LEN(pv), flags) + #define get_cvs(str, flags) \ Perl_get_cvn_flags(aTHX_ STR_WITH_LEN(str), (flags)) |