Compare commits
No commits in common. "c45131d029d500e4ad5bcb42d1d1ccdd5727a094" and "fe49453d0a961a97f26bbc7a314e2d326e37e99c" have entirely different histories.
c45131d029
...
fe49453d0a
@ -154,8 +154,8 @@ prune_children(node_t **simplified, node_t *root)
|
|||||||
switch (root->type)
|
switch (root->type)
|
||||||
{
|
{
|
||||||
case GLOBAL:
|
case GLOBAL:
|
||||||
//case ARGUMENT_LIST:
|
case ARGUMENT_LIST:
|
||||||
//case PARAMETER_LIST:
|
case PARAMETER_LIST:
|
||||||
case STATEMENT:
|
case STATEMENT:
|
||||||
case PRINT_ITEM:
|
case PRINT_ITEM:
|
||||||
case PRINT_STATEMENT:
|
case PRINT_STATEMENT:
|
||||||
@ -287,6 +287,7 @@ flatten(node_t **simplified, node_t *root)
|
|||||||
*simplified = result;
|
*simplified = result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
simplify_tree ( node_t **simplified, node_t *root )
|
simplify_tree ( node_t **simplified, node_t *root )
|
||||||
{
|
{
|
||||||
@ -301,4 +302,4 @@ simplify_tree ( node_t **simplified, node_t *root )
|
|||||||
flatten(&root, root);
|
flatten(&root, root);
|
||||||
|
|
||||||
*simplified = root;
|
*simplified = root;
|
||||||
}
|
}
|
||||||
|
@ -85,10 +85,9 @@ tree_print(node_t* root, stem head)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
printf("─%s", node_string[root->type]);
|
printf("─%s", node_string[root->type]);
|
||||||
if ( root->type == IDENTIFIER_DATA ||
|
if ( root->type == IDENTIFIER_DATA ||
|
||||||
root->type == STRING_DATA ||
|
root->type == STRING_DATA ||
|
||||||
root->type == EXPRESSION ||
|
root->type == EXPRESSION )
|
||||||
root->type == RELATION)
|
|
||||||
printf("(%s)", (char *) root->data);
|
printf("(%s)", (char *) root->data);
|
||||||
else if (root->type == NUMBER_DATA)
|
else if (root->type == NUMBER_DATA)
|
||||||
printf("(%ld)", *((int64_t *)root->data));
|
printf("(%ld)", *((int64_t *)root->data));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user