diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-07-21 02:17:43 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-07-21 02:17:43 -0400 |
commit | 2616052469b26e77c2f9eb161c7bffe78d3c35e8 (patch) | |
tree | 36215c91949fa73982317970ad1f52860b4918aa /Keyword.xs | |
parent | adddde6006f8e3b9c330361f0f1734b3f6072d01 (diff) | |
download | parse-keyword-2616052469b26e77c2f9eb161c7bffe78d3c35e8.tar.gz parse-keyword-2616052469b26e77c2f9eb161c7bffe78d3c35e8.zip |
improve the api a bit
Diffstat (limited to 'Keyword.xs')
-rw-r--r-- | Keyword.xs | 24 |
1 files changed, 6 insertions, 18 deletions
@@ -79,17 +79,6 @@ lex_read_space() 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: I32 floor; @@ -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 |