Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Match block range case. #32

Open
sts10 opened this issue Jan 30, 2023 · 1 comment
Open

Implement Match block range case. #32

sts10 opened this issue Jan 30, 2023 · 1 comment

Comments

@sts10
Copy link
Contributor

sts10 commented Jan 30, 2023

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'
^
@fubark
Copy link
Owner

fubark commented Jan 30, 2023

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

@fubark fubark changed the title matching example from docs currently throws an error Implement Match block range. Jan 30, 2023
@fubark fubark changed the title Implement Match block range. Implement Match block range case. Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants