Fixes
This commit is contained in:
parent
61290a18b9
commit
c5c58f07bc
3 changed files with 3 additions and 4 deletions
1
Makefile
1
Makefile
|
@ -20,7 +20,6 @@ BUILD_DIR = build
|
||||||
SRC_DIR = src
|
SRC_DIR = src
|
||||||
|
|
||||||
OBJS = $(patsubst $(SRC_DIR)/%.c,build-tmp/%.o,$(wildcard $(SRC_DIR)/*.c))
|
OBJS = $(patsubst $(SRC_DIR)/%.c,build-tmp/%.o,$(wildcard $(SRC_DIR)/*.c))
|
||||||
OBJS += build-tmp/y.tab.o build-tmp/lex.yy.o
|
|
||||||
|
|
||||||
all: | builddir yacc build builddir2
|
all: | builddir yacc build builddir2
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,7 @@ FnSig bi_sig[] = {
|
||||||
|
|
||||||
Statement *make_operation(i32 type, i32 extrainf, char *name, i32 nparam,
|
Statement *make_operation(i32 type, i32 extrainf, char *name, i32 nparam,
|
||||||
Statement *param, ...){
|
Statement *param, ...){
|
||||||
printf("make_operation: ", name);
|
printf("make_operation: ");
|
||||||
Statement *stat = &stack->statements[stack->curr_statement++];
|
Statement *stat = &stack->statements[stack->curr_statement++];
|
||||||
if(nparam)
|
if(nparam)
|
||||||
stat->children = malloc(sizeof(void*)*nparam);
|
stat->children = malloc(sizeof(void*)*nparam);
|
||||||
|
@ -136,7 +136,7 @@ Statement *make_operation(i32 type, i32 extrainf, char *name, i32 nparam,
|
||||||
|
|
||||||
va_list prm;
|
va_list prm;
|
||||||
va_start(prm, param);
|
va_start(prm, param);
|
||||||
for(int i = 0; i < fnsig->n_param; i++){
|
for(int i = 0; i < nparam; i++){
|
||||||
Statement *prm_n = va_arg(prm, Statement*);
|
Statement *prm_n = va_arg(prm, Statement*);
|
||||||
stat->children[stat->child_n++] = prm_n;
|
stat->children[stat->child_n++] = prm_n;
|
||||||
stack->curr_statement++;
|
stack->curr_statement++;
|
||||||
|
|
|
@ -67,7 +67,7 @@ stmt:
|
||||||
}
|
}
|
||||||
| '(' WHILE stmt stmt_list ')'
|
| '(' WHILE stmt stmt_list ')'
|
||||||
{}
|
{}
|
||||||
| '(' FN fn_args stmt_list ')'
|
| '(' FN '(' fn_args ')' stmt_list ')'
|
||||||
{}
|
{}
|
||||||
| '(' GTEQ stmt stmt ')'
|
| '(' GTEQ stmt stmt ')'
|
||||||
{}
|
{}
|
||||||
|
|
Loading…
Add table
Reference in a new issue