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

eclipse-aascw / aas-core-codegen / 36063653085
90%

Build:
DEFAULT BRANCH: main
Ran 24 Sep 2026 09:52PM UTC
Jobs 3
Files 285
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

24 Sep 2026 09:47PM UTC coverage: 87.836% (+0.4%) from 87.411%
36063653085

push

github

web-flow
Transpile equality if-chains as switches (#765)

We understand the chains of ``if``, ``elif`` and ``else`` in the bodies
of transpilable functions as switches, provided all the conditions
compare the same subject against constants, in one of the forms
``subject == label``, ``subject == label1 or subject == label2``, or
``subject in (label1, label2)``. The labels are string or integer
literals, or enumeration literals. A sole ``pass`` denotes an empty
branch. Other ``if``'s are refused for now; we plan to introduce the
general if-statement later.

The parse tree gets a ``Switch`` node, and ``StatementUnion`` restricts
the bodies of the branches to statements. The type inference checks
the subject and the labels, and treats the branches as block scopes.
Since Python has only function-level scopes, we refuse the collisions
of variable names where the two would diverge so that the meta-model
code behaves the same in all the targets.

C#, Go and TypeScript switch natively. Java switches with the arrow
form, except on ``long``, and C++ switches except on strings; there, we
fall back to chains of ``if`` and ``else if``. Python keeps the chain,
as the SDK still supports Python 3.9 without ``match``.

Along the way, we fix the declarations of local variables which had
been broken: Java declared them with Python type names,
TypeScript did not declare them at all, and the optional and pointer
inferrers of C++, Java and Go refused them.

The new common meta-model ``switch_statements`` covers all the variants,
and is live-tested in all the targets.

742 of 844 new or added lines in 13 files covered. (87.91%)

38127 of 43407 relevant lines covered (87.84%)

2.64 hits per line

Uncovered Changes

Lines Coverage ∆ File
17
70.27
6.41% aas_core_codegen/cpp/transpilation.py
15
73.91
5.86% aas_core_codegen/java/transpilation.py
12
77.67
0.61% aas_core_codegen/parse/tree.py
10
71.34
5.66% aas_core_codegen/python/transpilation.py
9
76.78
5.15% aas_core_codegen/csharp/transpilation.py
9
74.03
5.39% aas_core_codegen/golang/transpilation.py
9
76.03
5.55% aas_core_codegen/typescript/transpilation.py
5
73.2
2.85% aas_core_codegen/cpp/optionaling.py
5
71.82
2.79% aas_core_codegen/golang/pointering.py
5
72.73
3.18% aas_core_codegen/java/optional.py
5
86.89
3.55% aas_core_codegen/parse/_rules.py
1
75.11
3.7% aas_core_codegen/intermediate/type_inference.py
Jobs
ID Job ID Ran Files Coverage
1 3.12 - 36063653085.1 24 Sep 2026 09:55PM UTC 285
87.84
GitHub Action Run
2 3.10 - 36063653085.2 24 Sep 2026 09:55PM UTC 285
87.84
GitHub Action Run
3 3.11 - 36063653085.3 24 Sep 2026 09:55PM UTC 285
87.84
GitHub Action Run
Source Files on build 36063653085
  • Tree
  • List 285
  • Changed 17
  • Source Changed 0
  • Coverage Changed 17
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • fa8b0fe8 on github
  • Prev Build on main (#36061803732)
  • Next Build on main (#36147852934)
  • 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