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

compiler: handle ranges as match conditions #5847

Merged
merged 1 commit into from
Jul 16, 2020

Conversation

spaceface777
Copy link
Member

@spaceface777 spaceface777 commented Jul 16, 2020

This PR allows using a range expression as a condition in a match:

match char {
    `0`..`9` { 'digit' }
    `A`..`Z` { 'uppercase' }
    `a`..`z` { 'lowercase' }
    else { 'other' }
}

@spytheman spytheman merged commit b900577 into vlang:master Jul 16, 2020
@spaceface777 spaceface777 deleted the match_ranges branch July 16, 2020 14:39
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

Successfully merging this pull request may close these issues.

2 participants