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: Pattern Matching Ranges #2008

Open
spotandjake opened this issue Feb 10, 2024 · 0 comments
Open

Compiler: Pattern Matching Ranges #2008

spotandjake opened this issue Feb 10, 2024 · 0 comments
Labels

Comments

@spotandjake
Copy link
Member

We should add the ability to match over ranges with pattern matching something like the example below (Note we have not yet implemented range syntax so this is subject to change):

match (char) {
  'A'..'Z' => print("Character is Uppercase Alpha"),
  'a'..'z' => print("Character is LowerCase Alpha"),
  '0'..'9' => print("Character is numeric"),
  '_' => print("Character is _"),
  _ => print("Other Character")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant