jakt
jakt copied to clipboard
parser: Error for invalid match patterns is not clear/actionable
The parser fails with expected '=>' after pattern case
if a case is a byte literal:
function main() {
match b'.' {
b';' => 0
else => 1
}
}
Match only accepts values as (expr) =>
, right now only variant names are allowed without parenthesis:
function main() {
match b'.' {
(b';') => 0
else => 1
}
}
oh okay, thank you. Should we leave this or close this?
The error should be more clear at the very least, and the syntax is still fairly experimental (like most of the language :P), so we can leave the issue open for "improve error message"
Since https://github.com/SerenityOS/jakt/commit/b0b7bddf6015319342418b43dd9c3ad3ce5102bd bare literals are accepted, so looks like this is not an issue anymore