ShaderLang icon indicating copy to clipboard operation
ShaderLang copied to clipboard

[Syntax] Add support for match statements

Open SirLynix opened this issue 3 years ago • 0 comments

It would be nice to support a match statement, but I'm unsure about the syntax that should be used.

let x: i32;
let result: i32;
match (x) { //< obligatory parenthesis? we already require them for if statements
   0:
   {
       // do something
       result = 42;
   }
   1..9:
   {
       result = 66;
   }
   _: {}
}

SirLynix avatar Jun 21 '22 10:06 SirLynix