| 113 | // non-numeric suffix, or any from_chars error. |
| 114 | template <typename T> |
| 115 | bool tryParseNumber(std::string_view s, T& out) { |
| 116 | const char* begin = s.data(); |
| 117 | const char* end = s.data() + s.size(); |
| 118 | if (begin < end && *begin == '+') ++begin; |
| 119 | const auto r = std::from_chars(begin, end, out); |
| 120 | return r.ec == std::errc{} && r.ptr == end; |
| 121 | } |
| 122 | |
| 123 | // Collect up to 4 whitespace-separated tokens for a CSS edge-value shorthand |
| 124 | // (margin, padding, and the border-* family). Returns the number of tokens |
no test coverage detected