ragel icon indicating copy to clipboard operation
ragel copied to clipboard

[ragel] something like define macros

Open adrian-thurston opened this issue 5 years ago • 0 comments



 via_parm   = ( sent_protocol LWS sent_by ( SEMI ( via_branch |
header_param ) )* )
                    >start_value %store_value;
 Via           = ( "Via"i | "v"i ) >write_value >start_field
%write_field HCOLON via_parm
                    ( COMMA %write_value via_parm )*;


So I would like to use smething like a C #define. This is, adding at
the top of my Ragel file:

  #define COMMA_SEPARATED_VALUES(VALUE) ">write_value >start_field
             %write_field HCOLON VALUE ( COMMA %write_value VALUE )*;"

And then in the machine write:

  Via = ( "Via"i | "v"i ) COMMA_SEPARATED_VALUE(via_parm)

Iñaki Baz Castillo [email protected] [email protected]

adrian-thurston avatar Oct 19 '19 16:10 adrian-thurston