I'm trying to solve "the typedef problem" in Close. Specifically, a variable declaration may include a "typedef" as part of the type specifier. But I need to know what's a typedef, and what's not a typedef, because the only rule for typedef is that it's a valid name.

So I want some kind of rule like:

token typedef_name {
   <identifier> {*}
}

and then:

method typedef_name($/) {
   if is_a_typedef(~$<identifier>) {
        make get_typedef_past(~$<identifier>);
   }
   else {
      FAIL_SOMEHOW();
   }
}

But I don't know how to fail. Is there an "official right way" to do this? Is there a "working way"? I could set a variable, and then check it in a predicate PIR closure, but ugh.

=Austin
_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Reply via email to