MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / __parse_weekday

Function __parse_weekday

system/lib/libcxx/src/experimental/tzdb.cpp:186–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186[[nodiscard]] static weekday __parse_weekday(istream& __input) {
187 // TZDB allows the shortest unique name.
188 switch (std::tolower(__input.get())) {
189 case 'f':
190 chrono::__skip(__input, "riday");
191 return Friday;
192
193 case 'm':
194 chrono::__skip(__input, "onday");
195 return Monday;
196
197 case 's':
198 switch (std::tolower(__input.get())) {
199 case 'a':
200 chrono::__skip(__input, "turday");
201 return Saturday;
202
203 case 'u':
204 chrono::__skip(__input, "nday");
205 return Sunday;
206 }
207 break;
208
209 case 't':
210 switch (std::tolower(__input.get())) {
211 case 'h':
212 chrono::__skip(__input, "ursday");
213 return Thursday;
214
215 case 'u':
216 chrono::__skip(__input, "esday");
217 return Tuesday;
218 }
219 break;
220 case 'w':
221 chrono::__skip(__input, "ednesday");
222 return Wednesday;
223 }
224
225 std::__throw_runtime_error("corrupt tzdb weekday: invalid name");
226}
227
228[[nodiscard]] static month __parse_month(istream& __input) {
229 // TZDB allows the shortest unique name.

Callers 1

__parse_onFunction · 0.85

Calls 4

__skipFunction · 0.85
__throw_runtime_errorFunction · 0.85
getMethod · 0.65
tolowerFunction · 0.50

Tested by

no test coverage detected