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

KarpelesLab / goro / 25321981980 / 1
13%
master: 13%

Build:
DEFAULT BRANCH: master
Ran 04 May 2026 01:34PM UTC
Files 386
Run time 13s
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

04 May 2026 01:32PM UTC coverage: 4.842% (+2.9%) from 1.953%
25321981980.1

push

github

MagicalTux
vm: add bytecode compiler (literals, vars, binops, if/while/for)

core/vm/vmcompiler walks compiled AST trees (phpv.Runnable)
and emits *vm.Function bytecode. Returns ErrUnsupported on
node types it doesn't understand yet, so the caller can fall
back to AST execution per-function.

Supports:
- Scalar literals (int/float/string/bool/null)
- The case-insensitive constants true/false/null
- Variable read (with undefined-variable warning)
- Binary arithmetic / bitwise / shift / compare / concat
- Unary -, ~, !
- Plain assignment $x = expr
- Compound assignment $x += expr (statement context only)
- Pre/post ++/--
- Short-circuit && and || (correct short-circuit semantics)
- if / elseif / else
- while / for / break / continue (single-level)
- return [expr]

Out of scope (returns ErrUnsupported, falls back to AST):
arrays/foreach, objects, references, try/catch, function
calls, generators, multi-level break/continue, type-hinted
return, user-defined constants, array/list destructure.

To expose the unexported AST node fields without breaking
encapsulation, core/compiler/vmaccess.go adds narrow getter
methods (LiteralVal, VariableName, OperatorOp/A/B, IfCond/Yes/No,
ForStart/Cond/Each/Code, WhileCond/Code, ReturnValue, …).
The vmcompiler matches on these getter interfaces, never on
concrete types — same pattern Goro already uses for
Writable/UndefinedChecker.

Differential tests in core/vm/vmcompiler/compile_test.go
compile each snippet through the AST and through the VM
emitter, run both, and assert identical return values.
Covers arithmetic, compare, vars, ++/--, if/else, while, for,
break, continue, short-circuit. ErrUnsupported is verified
against array literals (which fall through correctly).

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

5484 of 113265 relevant lines covered (4.84%)

785.22 hits per line

Source Files on job 25321981980.1
  • Tree
  • List 386
  • Changed 55
  • Source Changed 3
  • Coverage Changed 53
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 25321981980
  • 6f2faf95 on github
  • Prev Job for on master (#25207297956.1)
  • Next Job for on master (#25322184655.1)
  • Delete
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