void execute(char* command) { if (create_tokens(command)) { create_process(); delete_tokens(); } }
void proceed_to_execution(t_var *var) { var->list = lexer(var, var->lex); var->list = create_tokens(var->list); var->root = parser(var->list); execute_tree(var, var->root); clean_tree(var->root); var->root = NULL; var->list = NULL; clean_line_pointers(var); }
}END_TEST START_TEST(test_create_tokens){ TokenList token; TokenList *tok=&token; char arg[]="one\"'te\\xt'\"two"; tok->next=create_tokens(arg); fail_unless(tok->next->token.type==TOK_NULL && tok->next->next->token.type==TOK_QUOTE && tok->next->next->next->token.type==TOK_QUOTE_STR && tok->next->next->next->next->token.type==TOK_QUOTE && tok->next->next->next->next->next->token.type==TOK_NULL); }END_TEST