mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 23:25:20 +00:00
Shell: Allow non-exhaustive 'case' statements in POSIX
This commit is contained in:
committed by
Ali Mohammad Pur
parent
ef551a045d
commit
8a042cd9cb
@@ -2363,7 +2363,9 @@ ErrorOr<RefPtr<Value>> MatchExpr::run(RefPtr<Shell> shell)
|
||||
return move(result).get<RefPtr<Value>>();
|
||||
}
|
||||
|
||||
shell->raise_error(Shell::ShellError::EvaluatedSyntaxError, "Non-exhaustive match rules!", position());
|
||||
// Non-exhaustive 'case' statements are valid in POSIX.
|
||||
if (!shell || !shell->posix_mode())
|
||||
shell->raise_error(Shell::ShellError::EvaluatedSyntaxError, "Non-exhaustive match rules!", position());
|
||||
return make_ref_counted<AST::ListValue>({});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user