ccomparini / fpl2cc

fpl parser generator language
https://ccomparini.github.io/fpl2cc/
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Add @join(joinval, collection) {@ to jemp #10

Open ccomparini opened 2 months ago

ccomparini commented 2 months ago

Make it so you can do (eg)

@join(", ", some_collection:item_in_collection) {@
    @item_in_collection@
@}@

... or some such syntax. @for ... @ is nice and all but hard to generate stuff for languages which don't allow trailing commas etc.

Another useful case:


@join(" else ", some_collection:item_in_collection) {@
    if(foo == @item_in_collection@) {
         do_something_with(foo);
    }
@}@

.. so that it generates a towering if/else relatively neatly.