Merge branch 'master' of github.com:jzck/42sh
This commit is contained in:
commit
8deadf99ef
2 changed files with 7 additions and 7 deletions
|
|
@ -257,7 +257,7 @@ t_aggrematch g_aggrematch[] =
|
||||||
{END_COMMAND, COMPLETE_CONDITION, PIPE_SEQUENCE, 0},
|
{END_COMMAND, COMPLETE_CONDITION, PIPE_SEQUENCE, 0},
|
||||||
{END_COMMAND, COMPOUND_LIST, COMPOUND_LIST, COMPOUND_LIST},
|
{END_COMMAND, COMPOUND_LIST, COMPOUND_LIST, COMPOUND_LIST},
|
||||||
{END_COMMAND, CASE_LIST_NS, CASE_LIST_NS, CASE_LIST_NS},
|
{END_COMMAND, CASE_LIST_NS, CASE_LIST_NS, CASE_LIST_NS},
|
||||||
{PIPE_SEMI_SEQUENCE, SEQUENCE, PIPE_SEMI_SEQUENCE, PIPE_SEMI_SEQUENCE},
|
{PIPE_SEMI_SEQUENCE, SEQUENCE, PIPE_SEMI_SEQUENCE, SEQUENCE},
|
||||||
{PIPE_SEQUENCE, TK_WHILE, PIPELINE, 0},
|
{PIPE_SEQUENCE, TK_WHILE, PIPELINE, 0},
|
||||||
{PIPE_SEQUENCE, TK_UNTIL, PIPELINE, 0},
|
{PIPE_SEQUENCE, TK_UNTIL, PIPELINE, 0},
|
||||||
{PIPE_SEQUENCE, TK_BANG, PIPELINE, TK_BANG},
|
{PIPE_SEQUENCE, TK_BANG, PIPELINE, TK_BANG},
|
||||||
|
|
@ -336,21 +336,21 @@ int aggregate_sym(t_list **stack, t_sym *new_sym, t_parstate *state)
|
||||||
return (1);
|
return (1);
|
||||||
i = 0;
|
i = 0;
|
||||||
head = (*stack)->content;
|
head = (*stack)->content;
|
||||||
// DG("aggregate head %s && sym %s",
|
DG("aggregate head %s && sym %s",
|
||||||
// read_state(*head), read_state(*new_sym));
|
read_state(*head), read_state(*new_sym));
|
||||||
while (g_aggrematch[i].top)
|
while (g_aggrematch[i].top)
|
||||||
{
|
{
|
||||||
if (*new_sym == g_aggrematch[i].top
|
if (*new_sym == g_aggrematch[i].top
|
||||||
&& MATCH_STACK(*head, g_aggrematch[i].under))
|
&& MATCH_STACK(*head, g_aggrematch[i].under))
|
||||||
|
|
||||||
{
|
{
|
||||||
// DG("MATCH : %s", read_state(g_aggrematch[i].new_sym));
|
DG("MATCH : %s", read_state(g_aggrematch[i].new_sym));
|
||||||
*new_sym = g_aggrematch[i].new_sym;
|
*new_sym = g_aggrematch[i].new_sym;
|
||||||
if (g_aggrematch[i].erase_sym)
|
if (g_aggrematch[i].erase_sym)
|
||||||
{
|
{
|
||||||
pop_stack(stack, g_aggrematch[i].erase_sym);
|
pop_stack(stack, g_aggrematch[i].erase_sym);
|
||||||
head = (*stack)->content;
|
head = (*stack)->content;
|
||||||
// DG("stack after pop: %s", read_state(*head));
|
DG("stack after pop: %s", read_state(*head));
|
||||||
}
|
}
|
||||||
if (eval_sym(stack, *new_sym))
|
if (eval_sym(stack, *new_sym))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -490,7 +490,6 @@ t_stackmatch g_stackmatch[] =
|
||||||
{TK_PAREN_CLOSE, TK_AND_IF},
|
{TK_PAREN_CLOSE, TK_AND_IF},
|
||||||
{TK_PAREN_CLOSE, TK_OR_IF},
|
{TK_PAREN_CLOSE, TK_OR_IF},
|
||||||
{TK_PAREN_CLOSE, TK_PIPE},
|
{TK_PAREN_CLOSE, TK_PIPE},
|
||||||
{TK_PAREN_CLOSE, TK_PAREN_CLOSE},
|
|
||||||
{TK_PAREN_CLOSE, COMPLETE_COMMANDS},
|
{TK_PAREN_CLOSE, COMPLETE_COMMANDS},
|
||||||
{TK_PAREN_CLOSE, CMD_SUPERIOR},
|
{TK_PAREN_CLOSE, CMD_SUPERIOR},
|
||||||
{TK_PAREN_CLOSE, PIPE_SEMI_SEQUENCE},
|
{TK_PAREN_CLOSE, PIPE_SEMI_SEQUENCE},
|
||||||
|
|
@ -1038,6 +1037,7 @@ t_stackmatch g_stackmatch[] =
|
||||||
{PIPE_SEMI_SEQUENCE, SEPARATOR_OP},
|
{PIPE_SEMI_SEQUENCE, SEPARATOR_OP},
|
||||||
{PIPE_SEMI_SEQUENCE, NEWLINE_LIST},
|
{PIPE_SEMI_SEQUENCE, NEWLINE_LIST},
|
||||||
{PIPE_SEMI_SEQUENCE, AND_OR_MAJOR},
|
{PIPE_SEMI_SEQUENCE, AND_OR_MAJOR},
|
||||||
|
{PIPE_SEMI_SEQUENCE, SEQUENCE},
|
||||||
{SEQUENCE, PIPE_SEMI_SEQUENCE},
|
{SEQUENCE, PIPE_SEMI_SEQUENCE},
|
||||||
{SEQUENCE, TK_WHILE},
|
{SEQUENCE, TK_WHILE},
|
||||||
{SEQUENCE, TK_UNTIL},
|
{SEQUENCE, TK_UNTIL},
|
||||||
|
|
@ -1124,7 +1124,7 @@ int eval_sym(t_list **stack, t_sym new_sym)
|
||||||
if (!*stack)
|
if (!*stack)
|
||||||
return (1);
|
return (1);
|
||||||
head = (*stack)->content;
|
head = (*stack)->content;
|
||||||
// DG("eval head %s && sym %s", read_state(*head), read_state(new_sym));
|
DG("eval head %s && sym %s", read_state(*head), read_state(new_sym));
|
||||||
i = 0;
|
i = 0;
|
||||||
while (g_stackmatch[i].top)
|
while (g_stackmatch[i].top)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue