mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
Shell: Accept IoNumber as a valid redirection target
This commit is contained in:
parent
0214e9b905
commit
986130d9ea
Notes:
sideshowbarker
2024-07-17 16:23:06 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/986130d9ea Pull-request: https://github.com/SerenityOS/serenity/pull/21173 Reviewed-by: https://github.com/gmta ✅
1 changed files with 10 additions and 1 deletions
|
@ -2073,7 +2073,16 @@ ErrorOr<RefPtr<AST::Node>> Parser::parse_io_file(AST::Position start_position, O
|
|||
|
||||
auto io_operator_token = consume();
|
||||
|
||||
auto word = TRY(parse_word());
|
||||
RefPtr<AST::Node> word;
|
||||
if (peek().type == Token::Type::IoNumber) {
|
||||
auto token = consume();
|
||||
word = make_ref_counted<AST::BarewordLiteral>(
|
||||
token.position.value_or(empty_position()),
|
||||
token.value);
|
||||
} else {
|
||||
word = TRY(parse_word());
|
||||
}
|
||||
|
||||
if (!word) {
|
||||
m_token_index = start_index;
|
||||
return nullptr;
|
||||
|
|
Loading…
Reference in a new issue