So I'd hope it won't throw empty elements at me, but you never know. :)

Ah. But the way I read your sample data it already has implicit empty elements.

({ 1, 2, "three", 0, ({ "internal", "array", 0, }), "end", }) ^ ^ | | Here and Here
If you read my original post to the end, you'd see I did indeed think about using P::RD

I did read it. I just didn't comprehend it properly. I think its cause my laptop has a small screen and after a while of using it I stop focussing properly. I need to get a monitor at home. Anyway yesterday I seemed to overlook a lot of things. Sorry about that. :-)

rule : production { $return = undef; 1; }
? Or am I understanding you wrong?

Actually I don't think that works. (At least I tried it and it did the below, but considering my other oversights of yesterday I make no strong claims :-) It seems to be semantically equivelent to

rule : production { $return = 1; }
As for leftop it just means you dont have to do tortured things to avoid left recursion which as far as I can tell is involved in this grammar. (I could be wrong).

Anyway, it was fun. Cheers. Oh when you benchmark dont forget failure cases as well as success. :-)

--- demerphq
my friends call me, usually because I'm late....


In reply to Re: Re: Re: Parsing Text into Arrays.. by demerphq
in thread Parsing Text into Arrays.. by castaway

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.