3.4. User Macro Statement

The syntax extension feature isn't limited to generated executable statements or definitions: you can actually generated macro statements, and thus extend the macro processor itself. The example below introduces a macro conditional that accepts some statements as an argument instead of using a macro goto.
Start felix section to tut/examples/mac303.flx[1 /1 ]
     1: #line 916 "./lpsrc/flx_tut_macro.pak"
     2: #include <flx.flxh>
     3: #statement#
     4:   IF expr do statements done; =>#
     5:   macro {
     6:     macro lab is new;
     7:     macro if not _1 goto lab;
     8:     _3;
     9:     macro lab:>
    10:   };
    11: #
    12: 
    13: IF 1 == 1 do
    14:   print "Hello"; endl;
    15: done;
    16: 
End felix section to tut/examples/mac303.flx[1]