2026-05-12 22:58:48 +01:00
|
|
|
#include "../syntax.h"
|
|
|
|
|
|
2026-05-25 10:33:29 +01:00
|
|
|
bool parse_expr(struct bshell_parse_ctx *ctx, struct bshell_ast_node **out)
|
2026-05-12 22:58:48 +01:00
|
|
|
{
|
|
|
|
|
bool ok = false;
|
|
|
|
|
if (!ok && peek_arith_expr(ctx)) {
|
2026-05-25 10:33:29 +01:00
|
|
|
ok = parse_arith_expr(ctx, BSHELL_PRECEDENCE_MINIMUM, out);
|
2026-05-12 22:58:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!ok && peek_command(ctx)) {
|
|
|
|
|
ok = parse_command(ctx, out);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ok;
|
|
|
|
|
}
|