anticontainer
anticontainer copied to clipboard
Make generator expression syntax accept nested expressions
Expand the generator expression syntax, used in both the generator
and builder
properties, to accept nested expressions within or
and replace
expressions. The following use cases are of interest:
-
{or:{url:1},2}
– to use url-matches instead of the normal finder-matches. -
{replace:{url:1},regexp,replacement}
– similar, to run a replacement on an url-match. -
{or:1,{replace:2,regexp,replacement}}
– to run a replacement on the match first. -
{replace:{or:1,2},regexp,{3}}
– and other really crazy combinations.
To support this, the expression functions would implicitely translate single numbers in parameters automatically to {num:N}
(or {N}
), providing full backwards compatibility.
Alternative would be to use a sandbox for this, but I feel that adds a lot more complexity than necessary.