# Sema: reimplement runtime switch · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/ea902ffe8f5f337b04f25b4efc69599db74d99ce)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: ea902ffe8f5f337b04f25b4efc69599db74d99ce

Requested commit: ea902ffe8f5f337b04f25b4efc69599db74d99ce

Commit: ea902ffe8f5f337b04f25b4efc69599db74d99ce

Tree: 7c0f184759b9ca8ebf9db49aa04ac91042eff705

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
Sema: reimplement runtime switch

Now supports multiple items pointing to the same body. This is a common
pattern even when using a jump table, with multiple cases pointing to
the same block of code.

In the case of a range specified, the items are moved to branches in the
else body. A future improvement may make it possible to have jump table
items as well as ranges pointing to the same block of code.

```

## Parents

- [caa0de545e2f45a96ac3136178f478dab1c89ebd](https://git.cafe/gitcafe/zig/commit/caa0de545e2f45a96ac3136178f478dab1c89ebd?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/ea902ffe8f5f337b04f25b4efc69599db74d99ce?format=markdown)
