Summary
src/arx/parser.py is ~97% line coverage; remaining misses are mostly rare module-level and primary-expression paths.
Gaps (from pytest --cov=arx --cov-report=term-missing)
parse(): TokenKind.not_initialized consume at start (~92).
- Module docstring in wrong position (~113–116).
- Top-level bare
; statements (~119–121).
extern: parse_extern path (~129–131, ~189–190) if not already covered by examples.
parse_primary: leading ; then recurse (~225–226); docstring in expression position (~232).
parse_var_expr: declarations without = relying on _default_value_for_type (~670).
Suggested approach
- Add compact parser tests in
tests/test_parser.py (or a focused file) with minimal valid modules exercising each branch.
- Align any new examples with
docs/library and syntax/arx.syntax.json if language surfaces change (should not be required for pure test additions).
Evidence
Recent local run: parser.py ~424 statements, ~14 missed (~97% cover).
Summary
src/arx/parser.pyis ~97% line coverage; remaining misses are mostly rare module-level and primary-expression paths.Gaps (from
pytest --cov=arx --cov-report=term-missing)parse():TokenKind.not_initializedconsume at start (~92).;statements (~119–121).extern:parse_externpath (~129–131, ~189–190) if not already covered by examples.parse_primary: leading;then recurse (~225–226);docstringin expression position (~232).parse_var_expr: declarations without=relying on_default_value_for_type(~670).Suggested approach
tests/test_parser.py(or a focused file) with minimal valid modules exercising each branch.docs/libraryandsyntax/arx.syntax.jsonif language surfaces change (should not be required for pure test additions).Evidence
Recent local run:
parser.py~424 statements, ~14 missed (~97% cover).