v-wasm
v-wasm copied to clipboard
Match keyword throws SyntaxError
The code:
number := 2
str := match number {
1 { 'one' }
2 { 'two' }
else { 'many'}
}
println('Value is $str')
Output:
SyntaxError: Unexpected token ';'
at Function (<anonymous>)
at HTMLButtonElement.<anonymous> (https://v-wasm.now.sh/main.js:132:34)
I think its not implemented yet.
Yeah, match
is just not implemented in the JS backend yet, unfortunately, so using it can produce invalid JS.
match
will actually produce an empty string, so the JS would look something like let str = ;
, which explains the error you’re getting. Similar thing for #4.
So this is actually an issue with V itself, given that the backend is still WIP.