Skip to content

[TM-223] Add 'case' statement

Sandeep.C.R requested to merge sras/tm223-case-statement into master

Description

This PR attempts to add a case statement to Indigo. Initially attempt was made to add a case expression, but the types didn't work out. So this PR contains a wip attempt to implement it as a statement.

Basically this piggybacks on the case instruction for Lorentz, and just adapts it to use in Indigo. So this PR adds a type IndigoCaseClauseL which is just a wrapper for the CaseClauseL type that the Lorentz case instruction uses. And then, when creating the IndigoM value, we use the Lorentz case_ function to generate embedded code.

Related issue(s)

https://issues.serokell.io/issue/TM-223

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:

Stylistic guide (mandatory)

Edited by Sandeep.C.R

Merge request reports