From d9ba2cbf2c8a35d2d11e2fa2f7fbd02d862bebfd Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 21 Jul 2013 16:51:56 -0400 Subject: reorder some stuff --- Keyword.xs | 60 ++++++++++++++++++++++++++-------------------------- lib/Parse/Keyword.pm | 4 ++-- 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: @@ -132,39 +162,9 @@ parse_arithexpr() OUTPUT: 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) { -- cgit v1.2.3-54-g00ecf