mirth-lang / mirth

Compiler for the Mirth programming language.
BSD Zero Clause License
447 stars 14 forks source link

add syntactic sugar for match and match cases #302

Closed typeswitch-dev closed 6 months ago

typeswitch-dev commented 6 months ago

This PR adds syntactic sugar to match. In particular:

So the following are equivalent:

match ( A -> B, C -> D )
match { A -> B, C -> D }
match ( { A -> B } { C -> D } )
match { { A -> B } { C -> D } }

In addition the new cases syntax carries over to definitions, so for example you can write,

def foo {
   { A -> B }
   { C -> D }
}