Brace expansion using ranges: Difference between revisions
Content added Content deleted
m (→{{header|Julia}}: add trigraph handling workaround) |
|||
Line 1,017: | Line 1,017: | ||
=={{header|Julia}}== |
=={{header|Julia}}== |
||
Julia currently does not handle certain trigraphs in strings correctly, such as 🌶, so that test is omitted. |
|||
<lang julia>padzeros(str) = (len = length(str)) > 1 && str[1] == '0' ? len : 0 |
<lang julia>padzeros(str) = (len = length(str)) > 1 && str[1] == '0' ? len : 0 |
||
function ranged(str) |
function ranged(str) |
||
rang = split(str |
rang = filter(!isempty, split(str, r"\{|\}|\.\.")) |
||
delta = length(rang) > 2 ? parse(Int, rang[3]) : 1 |
delta = length(rang) > 2 ? parse(Int, rang[3]) : 1 |
||
if delta < 0 |
if delta < 0 |
||
Line 1,066: | Line 1,065: | ||
simpleAlphaDescending-{Z..X}.txt-> |
simpleAlphaDescending-{Z..X}.txt-> |
||
simpleAlphaDescending-Z.txt |
simpleAlphaDescending-Char[]Z.txt |
||
simpleAlphaDescending-Y.txt |
simpleAlphaDescending-Char[]Y.txt |
||
simpleAlphaDescending-X.txt |
simpleAlphaDescending-Char[]X.txt |
||
steppedDownAndPadded-{10..00..5}.txt-> |
steppedDownAndPadded-{10..00..5}.txt-> |
||
Line 1,081: | Line 1,080: | ||
combined-{Q..P}{2..1}.txt-> |
combined-{Q..P}{2..1}.txt-> |
||
combined-Q2.txt |
combined-Char[]Q2.txt |
||
combined-Q1.txt |
combined-Char[]Q1.txt |
||
combined-P2.txt |
combined-Char[]P2.txt |
||
combined-P1.txt |
combined-Char[]P1.txt |
||
emoji{�..�}{�..�}etc-> |
|||
emojiChar[]�Char[]�etc |
|||
emojiChar[]�Char[]�etc |
|||
emojiChar[]�Char[]�etc |
|||
emojiChar[]�Char[]�etc |
|||
li{teral-> |
li{teral-> |
||
Line 1,099: | Line 1,104: | ||
steppedAlphaRising{P..Z..2}.txt-> |
steppedAlphaRising{P..Z..2}.txt-> |
||
steppedAlphaRisingChar[]P.txt |
|||
steppedAlphaRisingChar[]R.txt |
|||
steppedAlphaRisingChar[]T.txt |
|||
steppedAlphaRisingChar[]V.txt |
|||
steppedAlphaRisingChar[]X.txt |
|||
steppedAlphaRisingChar[]Z.txt |
|||
stops after endpoint-{02..10..3}.txt-> |
stops after endpoint-{02..10..3}.txt-> |