librelist archives

« back to archive

Cannot read property "0.0" from undefined

Cannot read property "0.0" from undefined

From:
Nick Fitzgerald
Date:
2010-09-07 @ 21:11
Hey Zach and everyone else on the list,

So, I have decided to write a mini language for macro preprocessing on JS. I
am trying to write the parser for the preprocessor language in Jison, and I
have hit a wall. I am not sure if this is my fault for creating a faulty
grammar, or a bug in Jison, or a bug in Narwhal...

To give some context, here is an example of a macro defined in my macro
language:

macro each '(' $var:item 'in' $expr:arr ')' $block:body
$gensyms:garr,gi,glen {
    var garr = #arr;
    var gi = 0;
    var glen = garr.length;
    for ( ; gi < glen; gi++) {
        #item = garr[gi];
        #body
    }
}

My code and the backtrace are included in the following gist:

http://gist.github.com/569081

Thanks so much for your time!

_Nick_

Re: [jison] Cannot read property "0.0" from undefined

From:
Zachary Carter
Date:
2010-09-07 @ 21:38
It's hard to tell from that stack trace what happened, but I doesn't appear
to be grammar related. I'd try removing code until it does run.

On Tue, Sep 7, 2010 at 5:11 PM, Nick Fitzgerald <fitzgen@gmail.com> wrote:

> Hey Zach and everyone else on the list,
>
> So, I have decided to write a mini language for macro preprocessing on JS.
> I am trying to write the parser for the preprocessor language in Jison, and
> I have hit a wall. I am not sure if this is my fault for creating a faulty
> grammar, or a bug in Jison, or a bug in Narwhal...
>
> To give some context, here is an example of a macro defined in my macro
> language:
>
> macro each '(' $var:item 'in' $expr:arr ')' $block:body
> $gensyms:garr,gi,glen {
>     var garr = #arr;
>     var gi = 0;
>     var glen = garr.length;
>     for ( ; gi < glen; gi++) {
>         #item = garr[gi];
>         #body
>     }
> }
>
> My code and the backtrace are included in the following gist:
>
> http://gist.github.com/569081
>
> Thanks so much for your time!
>
> _Nick_
>
>


-- 
Zach Carter