summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-07-21 16:51:56 -0400
committerJesse Luehrs <doy@tozt.net>2013-07-21 16:51:56 -0400
commitd9ba2cbf2c8a35d2d11e2fa2f7fbd02d862bebfd (patch)
tree1b1fcdc7f2f5d88f5293a552fd61b2fde38c1327
parent597610ad1c915a5b004148fdb3151b0cec976790 (diff)
downloadparse-keyword-d9ba2cbf2c8a35d2d11e2fa2f7fbd02d862bebfd.tar.gz
parse-keyword-d9ba2cbf2c8a35d2d11e2fa2f7fbd02d862bebfd.zip
reorder some stuff
-rw-r--r--Keyword.xs60
-rw-r--r--lib/Parse/Keyword.pm4
2 files changed, 32 insertions, 32 deletions
diff --git a/Keyword.xs b/Keyword.xs
index b041e25..6819978 100644
--- a/Keyword.xs
+++ b/Keyword.xs
@@ -84,12 +84,42 @@ install_keyword_handler(keyword, handler)
CODE:
cv_set_call_parser((CV*)SvRV(keyword), parser_callback, handler);
+SV *
+lex_peek(len = 1)
+ UV len
+ CODE:
+ PL_curcop = &PL_compiling;
+ while (PL_parser->bufend - PL_parser->bufptr < len) {
+ if (!lex_next_chunk(LEX_KEEP_PREVIOUS)) {
+ break;
+ }
+ }
+ 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
+
+void
+lex_read(len = 1)
+ UV len
+ CODE:
+ PL_curcop = &PL_compiling;
+ lex_read_to(PL_parser->bufptr + len);
+
void
lex_read_space()
CODE:
PL_curcop = &PL_compiling;
lex_read_space(0);
+void
+lex_stuff(str)
+ SV *str
+ CODE:
+ lex_stuff_sv(str, 0);
+
SV *
parse_block()
PREINIT:
@@ -133,38 +163,8 @@ parse_arithexpr()
RETVAL
SV *
-lex_peek(len = 1)
- UV len
- CODE:
- PL_curcop = &PL_compiling;
- while (PL_parser->bufend - PL_parser->bufptr < len) {
- if (!lex_next_chunk(LEX_KEEP_PREVIOUS)) {
- break;
- }
- }
- 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
-
-void
-lex_read(len = 1)
- UV len
- CODE:
- PL_curcop = &PL_compiling;
- lex_read_to(PL_parser->bufptr + len);
-
-SV *
compiling_package()
CODE:
RETVAL = newSVsv(PL_curstname);
OUTPUT:
RETVAL
-
-void
-lex_stuff(str)
- SV *str
- CODE:
- lex_stuff_sv(str, 0);
diff --git a/lib/Parse/Keyword.pm b/lib/Parse/Keyword.pm
index 83acbbd..d49b7f1 100644
--- a/lib/Parse/Keyword.pm
+++ b/lib/Parse/Keyword.pm
@@ -46,12 +46,12 @@ sub import {
my @helpers = qw(
lex_peek
- lex_read_space
lex_read
+ lex_read_space
+ lex_stuff
parse_block
parse_arithexpr
compiling_package
- lex_stuff
);
for my $helper (@helpers) {