[ragel-users] Feature suggestion: action suppression flag
Adrian Thurston
thurs... at cs.queensu.ca
Mon Mar 24 18:24:36 UTC 2008
Hi Jason,
This need has come up before and it's something I'd like to do. I think
it will come more easily when there is a "macro" syntax in ragel. Then
it can appear as:
world = 'world' @w;
main := 'hello ' . strip(world);
-Adrian
Jason Garber wrote:
> It would be handy to have a way to suppress all actions in a pattern.
> I've found a few cases in RedCloth where I want to reuse a pattern but
> I don't want the actions to take effect. For example, one pattern
> identifies dimension phrases (like "1x2x3") and another identifies all
> phrases that don't include the dimension pattern (e.g. phrase --
> dim). I can't reuse the first pattern when excluding it from the
> second, though, because the embedded actions alter the phrase I'm
> trying to capture. I wind up duplicating the dim pattern
> (dim_noactions), which isn't very DRY.
>
> Maybe there's already such a thing or maybe I could avoid the problem
> entirely by going a different route, but since this problem has come
> up for me several times, I wanted to suggest the enhancement.
>
> Jason
> >
>
More information about the ragel-users
mailing list