1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:17:36 +00:00

Shell: Add support for the bashy list literals in POSIX mode

This is currently only allowed in assignments, where x=(...) is parsed
as the assignment of the list (...) to the variable x.
This commit is contained in:
Ali Mohammad Pur 2023-10-05 13:09:43 +03:30 committed by Ali Mohammad Pur
parent ebe254a6d3
commit dc495e299e
5 changed files with 98 additions and 4 deletions

View file

@ -21,8 +21,13 @@ public:
(void)fill_token_buffer(starting_reduction);
}
enum class AllowNewlines {
No,
Yes,
};
RefPtr<AST::Node> parse();
RefPtr<AST::Node> parse_word_list();
RefPtr<AST::Node> parse_word_list(AllowNewlines = AllowNewlines::No);
struct Error {
DeprecatedString message;
@ -94,6 +99,7 @@ private:
ErrorOr<RefPtr<AST::Node>> parse_io_file(AST::Position, Optional<int> fd);
ErrorOr<RefPtr<AST::Node>> parse_io_here(AST::Position, Optional<int> fd);
ErrorOr<RefPtr<AST::Node>> parse_word();
ErrorOr<RefPtr<AST::Node>> parse_bash_like_list();
ErrorOr<CaseItemsResult> parse_case_list();
template<typename... Ts>