Compare commits
2 Commits
fe49453d0a
...
c45131d029
Author | SHA1 | Date |
---|---|---|
Øyvind Skaaden | c45131d029 | |
Øyvind Skaaden | a97b6602a0 |
|
@ -154,8 +154,8 @@ prune_children(node_t **simplified, node_t *root)
|
|||
switch (root->type)
|
||||
{
|
||||
case GLOBAL:
|
||||
case ARGUMENT_LIST:
|
||||
case PARAMETER_LIST:
|
||||
//case ARGUMENT_LIST:
|
||||
//case PARAMETER_LIST:
|
||||
case STATEMENT:
|
||||
case PRINT_ITEM:
|
||||
case PRINT_STATEMENT:
|
||||
|
@ -287,7 +287,6 @@ flatten(node_t **simplified, node_t *root)
|
|||
*simplified = result;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
simplify_tree ( node_t **simplified, node_t *root )
|
||||
{
|
||||
|
@ -302,4 +301,4 @@ simplify_tree ( node_t **simplified, node_t *root )
|
|||
flatten(&root, root);
|
||||
|
||||
*simplified = root;
|
||||
}
|
||||
}
|
|
@ -85,9 +85,10 @@ tree_print(node_t* root, stem head)
|
|||
return;
|
||||
}
|
||||
printf("─%s", node_string[root->type]);
|
||||
if ( root->type == IDENTIFIER_DATA ||
|
||||
root->type == STRING_DATA ||
|
||||
root->type == EXPRESSION )
|
||||
if ( root->type == IDENTIFIER_DATA ||
|
||||
root->type == STRING_DATA ||
|
||||
root->type == EXPRESSION ||
|
||||
root->type == RELATION)
|
||||
printf("(%s)", (char *) root->data);
|
||||
else if (root->type == NUMBER_DATA)
|
||||
printf("(%ld)", *((int64_t *)root->data));
|
||||
|
|
Loading…
Reference in New Issue