Commit 16ced69d authored by Sergio Costas's avatar Sergio Costas

Now appends the function parameters

Fixed bug when passing a variable name or type
parent 53c6f56d
......@@ -381,7 +381,11 @@ class crusty(object):
def process_functions(self, tree, var_container, function_container):
for node in tree:
if node.type == "FUNCTION_DEFINITION":
self._process_block(node.child1,var_container, function_container)
tmpvars = self._copy_container(var_container)
tmpvars.insert(0,{})
for element in node.function_params:
tmpvars[0][element.name] = {"properties":self._get_variable_properties(element,False), "status":crusty.STATUS_NOT_NULL_OR_NULL, "init_line": element.line, "pointer": element.pointer }
self._process_block(node.child1,tmpvars, function_container)
def _process_block(self, tree, var_container, function_container):
......
......@@ -247,6 +247,7 @@ void count() {
int prepare_leaf(unsigned long long int v1, double v2, int current_token) {
char *data;
struct AST *leaf2;
if (yytext == NULL) {
data = NULL;
} else {
......@@ -343,10 +344,10 @@ int prepare_leaf(unsigned long long int v1, double v2, int current_token) {
yylval->data = strdup("0");
yylval->intval = 0;
current_token = CONSTANT;
yylval->type = current_token;
break;
case TYPENAME_IDENTIFIER:
{
struct AST *leaf2 = find_type(yytext);
leaf2 = find_type(yytext);
if (leaf2 != NULL) {
mix_ast_leaves(yylval,leaf2);
yylval->t_typedef = false;
......@@ -354,7 +355,7 @@ int prepare_leaf(unsigned long long int v1, double v2, int current_token) {
} else {
current_token = IDENTIFIER;
}
}
yylval->type = current_token;
break;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment