• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stillwater-sc / universal / 25960118240
84%
master: 84%

Build:
Build:
LAST BUILD BRANCH: fix/issue-1002-ereal-highprec-constants
DEFAULT BRANCH: master
Ran 16 May 2026 11:23AM UTC
Jobs 1
Files 648
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

16 May 2026 10:54AM UTC coverage: 83.929% (-0.02%) from 83.946%
25960118240

push

github

web-flow
feat(utility): constexpr string-parse primitives (Phase A of #835) (#838)

* feat(utility): constexpr string-parse primitives (Phase A of #835)

Adds include/sw/universal/utility/string_parse.hpp -- a shared foundation
of constexpr-friendly primitives that the number systems will adopt in
later phases of issue #835.

Why
---
Today's parse() implementations are reimplemented per type (posit,
cfloat, integer, fixpnt, lns, ...), each with its own scanner. Format
coverage has diverged (lns refuses decimal value strings while fixpnt
accepts them; posit accepts a custom "nbits.esXhex" form; etc.). Without
a shared foundation, every type that adopts string parsing will continue
this divergence.

This file is the foundation. All primitives operate on std::string_view
and are constexpr -- they can be called from constexpr ctors once the
number systems are migrated in Phase B.

What's in the header
--------------------
sw::universal::string_parse namespace:

  enum number_base { binary, octal, decimal, hex, unknown };

  prefix_scan         scan_prefix(string_view);      // 0b/0o/0x -> base + body
  sign_scan           scan_sign(string_view);        // +/- detection
  bit_pattern_result  parse_binary/parse_octal/parse_hex(string_view);
                                                     // MSB-first uint64_t with overflow
  decimal_float_scan  scan_decimal_float(string_view);
                                                     // [-+]?int.frac[eE][-+]?exp
                                                     // returns string_views into input
                                                     // plus signed int32 exponent

Plus character classifiers (is_decimal_digit, is_hex_digit, ...) and a
hex_digit_value helper.

Phase A explicitly does NOT perform value reconstruction (turning
digit strings into a number type's bit representation). That step
depends on the target type's precision and rounding rules and so
belongs in each type's own parse() in Phase B.

... (continued)

46020 of 54832 relevant lines covered (83.93%)

6388355.13 hits per line

Coverage Regressions

Lines Coverage ∆ File
8
93.48
-0.48% include/sw/universal/number/cfloat/cfloat_impl.hpp
3
80.58
-0.67% include/sw/universal/number/posit1/specialized/posit_16_1.hpp
Jobs
ID Job ID Ran Files Coverage
1 25960118240.1 16 May 2026 11:23AM UTC 648
83.93
GitHub Action Run
Source Files on build 25960118240
  • Tree
  • List 648
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #25960118240
  • 06d237b8 on github
  • Prev Build on main (#25949395949)
  • Next Build on main (#25962306993)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc