From 2616052469b26e77c2f9eb161c7bffe78d3c35e8 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 21 Jul 2013 02:17:43 -0400 Subject: improve the api a bit --- Keyword.xs | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'Keyword.xs') diff --git a/Keyword.xs b/Keyword.xs index a1de202..56daf49 100644 --- a/Keyword.xs +++ b/Keyword.xs @@ -78,17 +78,6 @@ lex_read_space() PL_curcop = &PL_compiling; lex_read_space(0); -SV* -lex_peek_unichar() - PREINIT: - I32 ch; - CODE: - PL_curcop = &PL_compiling; - ch = lex_peek_unichar(0); - RETVAL = newSVpvf("%c", (int)ch); /* XXX unicode */ - OUTPUT: - RETVAL - SV* parse_block() PREINIT: @@ -105,8 +94,8 @@ parse_block() OUTPUT: RETVAL -void -ensure_linestr_len(len) +SV * +lex_peek(len) UV len CODE: PL_curcop = &PL_compiling; @@ -115,11 +104,10 @@ ensure_linestr_len(len) break; } } - -SV* -linestr() - CODE: - RETVAL = newSVpvn(PL_parser->bufptr, PL_parser->bufend - PL_parser->bufptr); + if (PL_parser->bufend - PL_parser->bufptr < len) { + len = PL_parser->bufend - PL_parser->bufptr; + } + RETVAL = newSVpvn(PL_parser->bufptr, len); /* XXX unicode? */ OUTPUT: RETVAL -- cgit v1.2.3-54-g00ecf