use (or) instead of (if) for a default

This commit is contained in:
2021-12-14 14:01:20 -07:00
parent 8b871bf8e9
commit 48f6fd9028

View File

@@ -5,7 +5,7 @@
:String blockTemplate :String blockTemplate
&opt :String flags] &opt :String flags]
[ [
&mut :String->Bool canConvert ->block ?(R.match regex block /*TODO use or for this */(if flags flags "")) &mut :String->Bool canConvert ->block ?(R.match regex block (or flags ""))
&mut :String->String convert ->_ "\$(let [groups .namedGroups (R.match #\"$(escapeRegex regex)\"# source \"$(if flags flags "")\") group ->g (dictGet groups g)] \"${blockTemplate}\")" &mut :String->String convert ->_ "\$(let [groups .namedGroups (R.match #\"$(escapeRegex regex)\"# source \"$(if flags flags "")\") group ->g (dictGet groups g)] \"${blockTemplate}\")"
]) ])