bind-stack allocation iterate

This commit is contained in:
John Kerl 2016-10-05 18:15:26 -04:00
parent 60775d90e2
commit 0bebaa7c9f
5 changed files with 13 additions and 5 deletions

View file

@ -278,7 +278,7 @@ static void mlr_dsl_cst_resolve_subr_callsites(mlr_dsl_cst_t* pcst) {
exit(1);
}
if (psubr_defsite->arity != psubr_callsite->arity) {
fprintf(stderr, "%s: subroutine \"%s\" expects argument count %d but argument count %d was provied.\n",
fprintf(stderr, "%s: subroutine \"%s\" expects argument count %d but argument count %d was provided.\n",
MLR_GLOBALS.bargv0, psubr_callsite->name, psubr_defsite->arity, psubr_callsite->arity);
exit(1);
}

View file

@ -345,13 +345,21 @@ static void analyzed_ast_allocate_locals_for_node(mlr_dsl_ast_node_t* pnode, sll
for (sllve_t* pe = pnode->pchildren->phead; pe != NULL; pe = pe->pnext) {
mlr_dsl_ast_node_t* pchild = pe->pvvalue;
// xxx special case for triple-for: only the body statement list is curly braced.
// the triple elements are not. maybe make some ast-node-type help here in the parser?
if (pchild->type == MD_AST_NODE_TYPE_STATEMENT_LIST) {
lhmsi_t* pnames_to_indices = lhmsi_alloc();
for (int i = 0; i < pframe_group->length; i++)
printf(":: ");
printf("PUSH FRAME\n");
sllv_prepend(pframe_group, pnames_to_indices);
analyzed_ast_allocate_locals_for_statement_list(pchild, pframe_group);
sllv_pop(pframe_group);
for (int i = 0; i < pframe_group->length; i++)
printf(":: ");
printf("POP FRAME\n");
lhmsi_free(pnames_to_indices);
} else {
analyzed_ast_allocate_locals_for_node(pchild, pframe_group);

View file

@ -1871,7 +1871,7 @@ SEE ALSO
2016-10-04 MILLER(1)
2016-10-05 MILLER(1)
</pre>
</div>
<p/>

View file

@ -1724,4 +1724,4 @@ SEE ALSO
2016-10-04 MILLER(1)
2016-10-05 MILLER(1)

View file

@ -2,12 +2,12 @@
.\" Title: mlr
.\" Author: [see the "AUTHOR" section]
.\" Generator: ./mkman.rb
.\" Date: 2016-10-04
.\" Date: 2016-10-05
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "MILLER" "1" "2016-10-04" "\ \&" "\ \&"
.TH "MILLER" "1" "2016-10-05" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Portability definitions
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~