mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:27:43 +00:00
Shell: Accept IoNumber as a valid redirection target
This commit is contained in:
parent
0214e9b905
commit
986130d9ea
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 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) {
|
if (!word) {
|
||||||
m_token_index = start_index;
|
m_token_index = start_index;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue