The plural specifier looks like * {NUM} {PLURAL passenger passengers} then it picks either passenger/passengers depending on the count in NUM */
| 173 | /* The plural specifier looks like |
| 174 | * {NUM} {PLURAL <ARG#> passenger passengers} then it picks either passenger/passengers depending on the count in NUM */ |
| 175 | static std::pair<std::optional<size_t>, std::optional<size_t>> ParseRelNum(StringConsumer &consumer) |
| 176 | { |
| 177 | consumer.SkipUntilCharNotIn(StringConsumer::WHITESPACE_NO_NEWLINE); |
| 178 | std::optional<size_t> v = consumer.TryReadIntegerBase<size_t>(10); |
| 179 | std::optional<size_t> offset; |
| 180 | if (v.has_value() && consumer.ReadCharIf(':')) { |
| 181 | /* Take the Nth within */ |
| 182 | offset = consumer.TryReadIntegerBase<size_t>(10); |
| 183 | if (!offset.has_value()) StrgenFatal("Expected number for substring parameter"); |
| 184 | } |
| 185 | return {v, offset}; |
| 186 | } |
| 187 | |
| 188 | /* Parse out the next word, or nullptr */ |
| 189 | std::optional<std::string_view> ParseWord(StringConsumer &consumer) |
no test coverage detected