2026-01-09 22:36:48 +00:00
|
|
|
#include "ast.h"
|
|
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
|
|
bool ast_is_if(struct ast *node)
|
|
|
|
|
{
|
|
|
|
|
return node->type == AST_IF;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool ast_is_cmd(struct ast *node)
|
|
|
|
|
{
|
|
|
|
|
return node->type == AST_CMD;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ast_if *ast_get_if(struct ast *node)
|
|
|
|
|
{
|
|
|
|
|
return (struct ast_if *)node->data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ast_cmd *ast_get_cmd(struct ast *node)
|
|
|
|
|
{
|
|
|
|
|
return (struct ast_cmd *)node->data;
|
|
|
|
|
}
|