cyber icon indicating copy to clipboard operation
cyber copied to clipboard

Implement Match block range case.

Open sts10 opened this issue 2 years ago • 1 comments

The matching example from Docs throws an error in the online playground.

val = 1000
match val:
    0..100: print 'at or between 0 and 99'
    100: print 'val is 100'
    200:
        print 'val is 200'
    300, 400:
        print 'combined case'
    else:
        print 'val is {val}'

The error I get is:

ParseError: Expected comma or colon.
main:3:6:
0..100: print 'at or between 0 and 99'
^

sts10 avatar Jan 30 '23 02:01 sts10

The match block was only recently implemented and doesn't handle the range case atm.

fubark avatar Jan 30 '23 02:01 fubark