Skip to content

Commit 7b86e89

Browse files
committed
chore: formatting Macros.ark and String.ark
1 parent 8b58933 commit 7b86e89

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

Macros.ark

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
(fun (bloc) (func ...defargs bloc))
1414
($undef bloc) })
1515

16-
($ __count_placeholders (acc x ...xs)
17-
($if (empty? xs)
16+
($ __count_placeholders (acc x ...xs) ($if (empty? xs)
1817
($if (= "_" ($repr x))
1918
(+ 1 acc)
2019
acc)
@@ -33,7 +32,8 @@
3332
(__replace_placeholders (tail replacements) ...xs) }
3433
{
3534
x
36-
(__replace_placeholders replacements ...xs) }))})
35+
36+
(__replace_placeholders replacements ...xs) })) })
3737

3838
($ partial2 (call ...args) {
3939
($ length (__count_placeholders 0 ...args))

String.ark

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -119,24 +119,22 @@
119119
(mut _i 0)
120120
(while (< _i _strlen) {
121121
(if (< _i _at)
122-
{
123-
(set _last (+ _last (@ _string _i)))
124-
(set _i (+ 1 _i))
125-
}
126-
{
127-
(append! _output _last)
128-
(set _last "")
129-
(set _i (+ _at _seplen))
130-
(set _at (string:find _string _separator _i))
131-
(if (= -1 _at)
132-
(set _at _strlen)) })})
122+
{
123+
(set _last (+ _last (@ _string _i)))
124+
(set _i (+ 1 _i)) }
125+
{
126+
(append! _output _last)
127+
(set _last "")
128+
(set _i (+ _at _seplen))
129+
(set _at (string:find _string _separator _i))
130+
(if (= -1 _at)
131+
(set _at _strlen)) }) })
133132

134133
(if (empty? _last)
135134
_output
136135
{
137-
(append! _output _last)
138-
_output
139-
}) })}))
136+
(append! _output _last)
137+
_output }) }) }))
140138

141139
# @brief Replace a substring in a given string
142140
# @param _string base string who contain pattern to replace by new sub string given

0 commit comments

Comments
 (0)