From 336e491e532144d1c8a6e367409149e8d084fa1d Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 21 Jul 2013 16:48:18 -0400 Subject: add parse_arithexpr --- Keyword.xs | 21 +++++++++++++++++++++ lib/Parse/Keyword.pm | 1 + 2 files changed, 22 insertions(+) diff --git a/Keyword.xs b/Keyword.xs index e5193c8..b041e25 100644 --- a/Keyword.xs +++ b/Keyword.xs @@ -111,6 +111,27 @@ parse_block() OUTPUT: RETVAL +SV * +parse_arithexpr() + PREINIT: + I32 floor; + CV *code; + CODE: + REENTER_PARSER; + + floor = start_subparse(0, CVf_ANON); + code = newATTRSUB(floor, NULL, NULL, NULL, parse_arithexpr(0)); + + LEAVE_PARSER; + + if (CvCLONE(code)) { + code = cv_clone(code); + } + + RETVAL = newRV_inc((SV*)code); + OUTPUT: + RETVAL + SV * lex_peek(len = 1) UV len diff --git a/lib/Parse/Keyword.pm b/lib/Parse/Keyword.pm index ee0049a..83acbbd 100644 --- a/lib/Parse/Keyword.pm +++ b/lib/Parse/Keyword.pm @@ -49,6 +49,7 @@ sub import { lex_read_space lex_read parse_block + parse_arithexpr compiling_package lex_stuff ); -- cgit v1.2.3-54-g00ecf