summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2010-08-15 21:36:11 +0100
committerFlorian Ragwitz <rafl@debian.org>2010-08-22 05:19:34 +0200
commit510966aa601964fcdb06b3cdf4dc8e1241107f1a (patch)
tree8918cb445f033514697f2ab02e0e405373b33c75
parentae5391ad3eac034928d0ad9aeb57e8d9f625142f (diff)
downloadperl-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.xs2
-rw-r--r--handy.h9
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)
diff --git a/handy.h b/handy.h
index d6205c52fc..bbeb1ff0f5 100644
--- a/handy.h
+++ b/handy.h
@@ -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))