summaryrefslogtreecommitdiff
path: root/offsets.c
diff options
context:
space:
mode:
authorSøren Sandmann <sandmann@redhat.com>2007-07-23 02:01:15 -0400
committerSøren Sandmann <sandmann@redhat.com>2007-07-23 02:01:15 -0400
commit117700a488359cddfbc2b1d22d18f516299bb2f6 (patch)
tree9c817781c8549864bfba6f678ea73f3563fd0e88 /offsets.c
parent054f44ed91cdfe330f047930f3df7d357a9c8ed6 (diff)
Add lambda expressions; update TODO
Diffstat (limited to 'offsets.c')
-rw-r--r--offsets.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/offsets.c b/offsets.c
index f55fd5a..1d12b7a 100644
--- a/offsets.c
+++ b/offsets.c
@@ -23,6 +23,9 @@ offsets_statement (ast_statement_t *statement,
int level,
int offset,
int *max);
+static void
+offsets_function (ast_function_definition_t *function,
+ int level);
static void
offsets_expression (ast_expression_t *expr,
@@ -53,6 +56,10 @@ offsets_expression (ast_expression_t *expr,
offsets_expression (expr->ternary.middle, level);
offsets_expression (expr->ternary.right, level);
break;
+
+ case AST_LAMBDA_EXPRESSION:
+ offsets_function (expr->lambda.function, level);
+ break;
case AST_CALL_EXPRESSION:
offsets_expression (expr->call.callee, level);
@@ -72,13 +79,11 @@ offsets_variable (ast_variable_definition_t *var,
{
int size;
-#if 0
if (!var->used)
{
g_print ("warning: unused variable %s\n", var->name);
return offset;
}
-#endif
switch (var->type_spec->common.type)
{
@@ -138,7 +143,9 @@ offsets_function (ast_function_definition_t *function,
function->env_size = max;
- g_print ("env size for %s: %d\n", function->name, function->env_size);
+ g_print ("env size for %s: %d\n",
+ function->name? function->name : "fn",
+ function->env_size);
}
static int