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

moonbitlang / core / 5648
90%

Build:
DEFAULT BRANCH: main
Ran 28 Jul 2026 11:27AM UTC
Jobs 1
Files 453
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

28 Jul 2026 11:25AM UTC coverage: 90.435%. Remained the same
5648

push

github

bobzhang
refactor: use `-=`, `*=` and `/=` for self-arithmetic

Completes the compound-assignment sweep started in #3945, which covered
only `+`. 21 sites in 11 files.

Found with moongrep, one pattern per operator:

    moongrep scan --pattern '$(a:id) = $(a:id) - $(_:exp)'   # 14
    moongrep scan --pattern '$(a:id) = $(a:id) * $(_:exp)'   #  5
    moongrep scan --pattern '$(a:id) = $(a:id) / $(_:exp)'   #  2

Matching on the AST makes this precedence-safe for free, which matters
much more for `*` and `/` than it did for `+`. `x = x * a + b` parses as
`Add(Mul(x, a), b)`, so its root is `Add` and the `*` pattern simply
does not match it — rewriting it to `x *= a + b` would have changed
`(x * a) + b` into `x * (a + b)`. In #3945 the equivalent trap had to be
excluded by hand with a top-level-operator scan over the text.

The family stops here. `%=`, `&=`, `|=`, `^=`, `<<=` and `>>=` are not
MoonBit syntax — `hx &= 0x7fffffff` is a parse error — even though the
corresponding `x = x & ...` shape occurs 64 times across the tree. Those
are left as-is.

Tests pass on wasm-gc, js and native; `moon info` reports no `.mbti`
change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

8 of 9 new or added lines in 6 files covered. (88.89%)

15789 of 17459 relevant lines covered (90.43%)

173601.36 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
97.06
0.0% builtin/double_ryu_nonjs.mbt
Jobs
ID Job ID Ran Files Coverage
1 5648.1 28 Jul 2026 11:27AM UTC 454
90.45
GitHub Action Run
Source Files on build 5648
  • Tree
  • List 453
  • Changed 9
  • Source Changed 9
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • b1fa47ca on github
  • Prev Build on main (#5646)
  • Next Build on main (#5650)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc