File tree Expand file tree Collapse file tree 2 files changed +15
-17
lines changed Expand file tree Collapse file tree 2 files changed +15
-17
lines changed Original file line number Diff line number Diff line change 13
13
(fun (bloc) (func ...defargs bloc))
14
14
($undef bloc) })
15
15
16
- ($ __count_placeholders (acc x ...xs)
17
- ($if (empty? xs)
16
+ ($ __count_placeholders (acc x ...xs) ($if (empty? xs)
18
17
($if (= "_" ($repr x))
19
18
(+ 1 acc)
20
19
acc)
33
32
(__replace_placeholders (tail replacements) ...xs) }
34
33
{
35
34
x
36
- (__replace_placeholders replacements ...xs) }))})
35
+
36
+ (__replace_placeholders replacements ...xs) })) })
37
37
38
38
($ partial2 (call ...args) {
39
39
($ length (__count_placeholders 0 ...args))
Original file line number Diff line number Diff line change 119
119
(mut _i 0)
120
120
(while (< _i _strlen) {
121
121
(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)) }) })
133
132
134
133
(if (empty? _last)
135
134
_output
136
135
{
137
- (append! _output _last)
138
- _output
139
- }) })}))
136
+ (append! _output _last)
137
+ _output }) }) }))
140
138
141
139
# @brief Replace a substring in a given string
142
140
# @param _string base string who contain pattern to replace by new sub string given
You can’t perform that action at this time.
0 commit comments