Skip to content

Commit 3fb2d71

Browse files
committed
Add todo comment to do replacements where needed
1 parent a8cc63d commit 3fb2d71

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

R/dt_replace.R

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ dt_replace <- function(dt, input_dt, dt_lett, locale, tz_info) {
77
# This means we can use sub() instead of gsub()
88

99
if ("G" %in% dt_lett) {
10+
# TODO extract the exact substitution to do to avoid problematic
1011
dt <- sub("{G}", dt_G(input_dt, locale), dt, fixed = TRUE)
1112
dt <- sub("{GG}", dt_G(input_dt, locale), dt, fixed = TRUE)
1213
dt <- sub("{GGG}", dt_G(input_dt, locale), dt, fixed = TRUE)
@@ -34,6 +35,7 @@ dt_replace <- function(dt, input_dt, dt_lett, locale, tz_info) {
3435
}
3536

3637
if ("U" %in% dt_lett) {
38+
# TODO extract the exact substitution to do to avoid problematic
3739
dt <- sub("{U}", dt_U(input_dt), dt, fixed = TRUE)
3840
dt <- sub("{UU}", dt_U(input_dt), dt, fixed = TRUE)
3941
dt <- sub("{UUU}", dt_U(input_dt), dt, fixed = TRUE)
@@ -47,6 +49,7 @@ dt_replace <- function(dt, input_dt, dt_lett, locale, tz_info) {
4749
}
4850

4951
if ("q" %in% dt_lett) {
52+
# TODO extract the exact substitution to do to avoid problematic
5053
dt <- sub("{q}", dt_q(input_dt), dt, fixed = TRUE)
5154
dt <- sub("{qq}", dt_qq(input_dt), dt, fixed = TRUE)
5255
dt <- sub("{qqq}", dt_qqq(input_dt, locale), dt, fixed = TRUE)
@@ -64,6 +67,7 @@ dt_replace <- function(dt, input_dt, dt_lett, locale, tz_info) {
6467
}
6568

6669
if ("L" %in% dt_lett) {
70+
# TODO extract the exact substitution to do to avoid problematic
6771
dt <- sub("{L}", dt_L(input_dt), dt, fixed = TRUE)
6872
dt <- sub("{LL}", dt_LL(input_dt), dt, fixed = TRUE)
6973
dt <- sub("{LLL}", dt_LLL(input_dt, locale), dt, fixed = TRUE)
@@ -72,6 +76,7 @@ dt_replace <- function(dt, input_dt, dt_lett, locale, tz_info) {
7276
}
7377

7478
if ("w" %in% dt_lett) {
79+
# TODO extract the exact substitution to do to avoid problematic
7580
dt <- sub("{w}", dt_w(input_dt), dt, fixed = TRUE)
7681
dt <- sub("{ww}", dt_ww(input_dt), dt, fixed = TRUE)
7782
}
@@ -95,6 +100,7 @@ dt_replace <- function(dt, input_dt, dt_lett, locale, tz_info) {
95100
}
96101

97102
if ("E" %in% dt_lett) {
103+
# TODO extract the exact substitution to do to avoid problematic
98104
dt <- sub("{E}", dt_E(input_dt, locale), dt, fixed = TRUE)
99105
dt <- sub("{EE}", dt_E(input_dt, locale), dt, fixed = TRUE)
100106
dt <- sub("{EEE}", dt_E(input_dt, locale), dt, fixed = TRUE)
@@ -104,6 +110,7 @@ dt_replace <- function(dt, input_dt, dt_lett, locale, tz_info) {
104110
}
105111

106112
if ("e" %in% dt_lett) {
113+
# TODO extract the exact substitution to do to avoid problematic
107114
dt <- sub("{e}", dt_e(input_dt, locale), dt, fixed = TRUE)
108115
dt <- sub("{ee}", dt_ee(input_dt, locale), dt, fixed = TRUE)
109116
dt <- sub("{eee}", dt_eee(input_dt, locale), dt, fixed = TRUE)
@@ -113,6 +120,7 @@ dt_replace <- function(dt, input_dt, dt_lett, locale, tz_info) {
113120
}
114121

115122
if ("c" %in% dt_lett) {
123+
# TODO extract the exact substitution to do to avoid problematic
116124
dt <- sub("{c}", dt_c(input_dt, locale), dt, fixed = TRUE)
117125
dt <- sub("{cc}", dt_cc(input_dt, locale), dt, fixed = TRUE)
118126
dt <- sub("{ccc}", dt_ccc(input_dt, locale), dt, fixed = TRUE)
@@ -122,6 +130,7 @@ dt_replace <- function(dt, input_dt, dt_lett, locale, tz_info) {
122130
}
123131

124132
if ("a" %in% dt_lett) {
133+
# TODO extract the exact substitution to do to avoid problematic
125134
dt <- sub("{a}", dt_a(input_dt, locale), dt, fixed = TRUE)
126135
dt <- sub("{aa}", dt_a(input_dt, locale), dt, fixed = TRUE)
127136
dt <- sub("{aaa}", dt_a(input_dt, locale), dt, fixed = TRUE)
@@ -130,6 +139,7 @@ dt_replace <- function(dt, input_dt, dt_lett, locale, tz_info) {
130139
}
131140

132141
if ("b" %in% dt_lett) {
142+
# TODO extract the exact substitution to do to avoid problematic
133143
dt <- sub("{b}", dt_b(input_dt, locale), dt, fixed = TRUE)
134144
dt <- sub("{bb}", dt_b(input_dt, locale), dt, fixed = TRUE)
135145
dt <- sub("{bbb}", dt_b(input_dt, locale), dt, fixed = TRUE)
@@ -138,6 +148,7 @@ dt_replace <- function(dt, input_dt, dt_lett, locale, tz_info) {
138148
}
139149

140150
if ("B" %in% dt_lett) {
151+
# TODO extract the exact substitution to do to avoid problematic
141152
dt <- sub("{B}", dt_B(input_dt, locale), dt, fixed = TRUE)
142153
dt <- sub("{BB}", dt_B(input_dt, locale), dt, fixed = TRUE)
143154
dt <- sub("{BBB}", dt_B(input_dt, locale), dt, fixed = TRUE)
@@ -146,6 +157,7 @@ dt_replace <- function(dt, input_dt, dt_lett, locale, tz_info) {
146157
}
147158

148159
if ("h" %in% dt_lett) {
160+
# TODO extract the exact substitution to do to avoid problematic
149161
dt <- sub("{h}", dt_h(input_dt), dt, fixed = TRUE)
150162
dt <- sub("{hh}", dt_hh(input_dt), dt, fixed = TRUE)
151163
}
@@ -159,26 +171,31 @@ dt_replace <- function(dt, input_dt, dt_lett, locale, tz_info) {
159171
}
160172

161173
if ("K" %in% dt_lett) {
174+
# TODO extract the exact substitution to do to avoid problematic
162175
dt <- sub("{K}", dt_K(input_dt), dt, fixed = TRUE)
163176
dt <- sub("{KK}", dt_KK(input_dt), dt, fixed = TRUE)
164177
}
165178

166179
if ("k" %in% dt_lett) {
180+
# TODO extract the exact substitution to do to avoid problematic
167181
dt <- sub("{k}", dt_k(input_dt), dt, fixed = TRUE)
168182
dt <- sub("{kk}", dt_kk(input_dt), dt, fixed = TRUE)
169183
}
170184

171185
if ("m" %in% dt_lett) {
186+
# TODO extract the exact substitution to do to avoid problematic
172187
dt <- sub("{m}", dt_m(input_dt), dt, fixed = TRUE)
173188
dt <- sub("{mm}", dt_mm(input_dt), dt, fixed = TRUE)
174189
}
175190

176191
if ("s" %in% dt_lett) {
192+
# TODO extract the exact substitution to do to avoid problematic
177193
dt <- sub("{s}", dt_s(input_dt), dt, fixed = TRUE)
178194
dt <- sub("{ss}", dt_ss(input_dt), dt, fixed = TRUE)
179195
}
180196

181197
if ("S" %in% dt_lett) {
198+
# TODO extract the exact substitution to do to avoid problematic
182199
dt <- sub("{S}", dt_S(input_dt), dt, fixed = TRUE)
183200
dt <- sub("{SS}", dt_SS(input_dt), dt, fixed = TRUE)
184201
dt <- sub("{SSS}", dt_SSS(input_dt), dt, fixed = TRUE)
@@ -191,6 +208,7 @@ dt_replace <- function(dt, input_dt, dt_lett, locale, tz_info) {
191208
}
192209

193210
if ("A" %in% dt_lett) {
211+
# TODO extract the exact substitution to do to avoid problematic
194212
dt <- sub("{A}", dt_A(input_dt), dt, fixed = TRUE)
195213
dt <- sub("{AA}", dt_AA(input_dt), dt, fixed = TRUE)
196214
dt <- sub("{AAA}", dt_AAA(input_dt), dt, fixed = TRUE)
@@ -203,13 +221,15 @@ dt_replace <- function(dt, input_dt, dt_lett, locale, tz_info) {
203221
}
204222

205223
if ("z" %in% dt_lett) {
224+
# TODO extract the exact substitution to do to avoid problematic
206225
dt <- sub("{z}", dt_z(input_dt, tz_info, locale), dt, fixed = TRUE)
207226
dt <- sub("{zz}", dt_z(input_dt, tz_info, locale), dt, fixed = TRUE)
208227
dt <- sub("{zzz}", dt_z(input_dt, tz_info, locale), dt, fixed = TRUE)
209228
dt <- sub("{zzzz}", dt_zzzz(input_dt, tz_info, locale), dt, fixed = TRUE)
210229
}
211230

212231
if ("Z" %in% dt_lett) {
232+
# TODO extract the exact substitution to do to avoid problematic
213233
dt <- sub("{Z}", dt_Z(input_dt, tz_info, locale), dt, fixed = TRUE)
214234
dt <- sub("{ZZ}", dt_Z(input_dt, tz_info, locale), dt, fixed = TRUE)
215235
dt <- sub("{ZZZ}", dt_Z(input_dt, tz_info, locale), dt, fixed = TRUE)
@@ -228,13 +248,15 @@ dt_replace <- function(dt, input_dt, dt_lett, locale, tz_info) {
228248
}
229249

230250
if ("V" %in% dt_lett) {
251+
# TODO extract the exact substitution to do to avoid problematic
231252
dt <- sub("{V}", dt_V(input_dt, tz_info, locale), dt, fixed = TRUE)
232253
dt <- sub("{VV}", dt_VV(input_dt, tz_info, locale), dt, fixed = TRUE)
233254
dt <- sub("{VVV}", dt_VVV(input_dt, tz_info, locale), dt, fixed = TRUE)
234255
dt <- sub("{VVVV}", dt_VVVV(input_dt, tz_info, locale), dt, fixed = TRUE)
235256
}
236257

237258
if ("X" %in% dt_lett) {
259+
# TODO extract the exact substitution to do to avoid problematic
238260
dt <- sub("{X}", dt_X(input_dt, tz_info, locale), dt, fixed = TRUE)
239261
dt <- sub("{XX}", dt_XX(input_dt, tz_info, locale), dt, fixed = TRUE)
240262
dt <- sub("{XXX}", dt_XXX(input_dt, tz_info, locale), dt, fixed = TRUE)
@@ -243,6 +265,7 @@ dt_replace <- function(dt, input_dt, dt_lett, locale, tz_info) {
243265
}
244266

245267
if ("x" %in% dt_lett) {
268+
# TODO extract the exact substitution to do to avoid problematic
246269
dt <- sub("{x}", dt_x(input_dt, tz_info, locale), dt, fixed = TRUE)
247270
dt <- sub("{xx}", dt_xx(input_dt, tz_info, locale), dt, fixed = TRUE)
248271
dt <- sub("{xxx}", dt_xxx(input_dt, tz_info, locale), dt, fixed = TRUE)
@@ -251,6 +274,7 @@ dt_replace <- function(dt, input_dt, dt_lett, locale, tz_info) {
251274
}
252275

253276
if ("g" %in% dt_lett) {
277+
# TODO extract the exact substitution to do to avoid problematic
254278
dt <- sub("{g}", dt_g(input_dt), dt, fixed = TRUE)
255279
dt <- sub("{gg}", dt_gg(input_dt), dt, fixed = TRUE)
256280
dt <- sub("{ggg}", dt_ggg(input_dt), dt, fixed = TRUE)

0 commit comments

Comments
 (0)