summaryrefslogtreecommitdiffstats
path: root/Keyword.xs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-07-21 02:17:43 -0400
committerJesse Luehrs <doy@tozt.net>2013-07-21 02:17:43 -0400
commit2616052469b26e77c2f9eb161c7bffe78d3c35e8 (patch)
tree36215c91949fa73982317970ad1f52860b4918aa /Keyword.xs
parentadddde6006f8e3b9c330361f0f1734b3f6072d01 (diff)
downloadparse-keyword-2616052469b26e77c2f9eb161c7bffe78d3c35e8.tar.gz
parse-keyword-2616052469b26e77c2f9eb161c7bffe78d3c35e8.zip
improve the api a bit
Diffstat (limited to 'Keyword.xs')
-rw-r--r--Keyword.xs24
1 files changed, 6 insertions, 18 deletions
diff --git a/Keyword.xs b/Keyword.xs
index a1de202..56daf49 100644
--- a/Keyword.xs
+++ b/Keyword.xs
@@ -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