DynLex Sections

Case

Use case inside a match or switch section to define one branch.

Pattern
case value:
Example
import lib/std.dl

set number to 3

match based on number:
    case 1:
        print "one" as line
    case 3:
        print "three" as line

A case belongs inside a match or switch section. It is not used on its own.

Try yourself

Add a new case for 2. Then change number and run the file again.