1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:47:35 +00:00

Shell: Implement arithmetic expansions for POSIX mode

This also adds a 'math' immediate function that can be used in Shell
proper to do arithmetic stuff.
This commit is contained in:
Ali Mohammad Pur 2023-03-21 03:53:24 +03:30 committed by Andreas Kling
parent d0112d76e9
commit 7c312980b0
4 changed files with 816 additions and 11 deletions

View file

@ -179,7 +179,12 @@ struct ResolvedCommandExpansion {
ExpansionRange range;
};
using ResolvedExpansion = Variant<ResolvedParameterExpansion, ResolvedCommandExpansion>;
struct ResolvedArithmeticExpansion {
String source_expression;
ExpansionRange range;
};
using ResolvedExpansion = Variant<ResolvedParameterExpansion, ResolvedCommandExpansion, ResolvedArithmeticExpansion>;
struct HeredocEntry {
String key;