fixing still
This commit is contained in:
@ -1601,6 +1601,7 @@ bool isConst(TNodeOrConst * tnc) {
|
||||
TNodeOrConst * tn_or_const(Discriminant d, void * tnc) {
|
||||
TNodeOrConst * count = calloc(1, sizeof(*count));
|
||||
count->d = d;
|
||||
count->tnc_union = calloc(1, sizeof(*count->tnc_union));
|
||||
switch (d) {
|
||||
case NODE:
|
||||
count->tnc_union->node = tnc;
|
||||
@ -1632,7 +1633,7 @@ static void emit_helper(void){
|
||||
} else {
|
||||
current->next = inst;
|
||||
inst->prev = current;
|
||||
inst->index = current->index++;
|
||||
inst->index = current->index+1;
|
||||
current = inst;
|
||||
}
|
||||
}
|
||||
@ -1661,6 +1662,7 @@ void emit_assignment(TableNode * target, TNodeOrConst * source){
|
||||
}
|
||||
|
||||
char * get_string(TNodeOrConst * tc){
|
||||
|
||||
char * s;
|
||||
switch (tc->d) {
|
||||
case NODE:
|
||||
@ -1670,10 +1672,12 @@ char * get_string(TNodeOrConst * tc){
|
||||
case STRING:
|
||||
return tc->tnc_union->string;
|
||||
case INTEGER:
|
||||
return getName(integ);
|
||||
s = calloc(10, sizeof(char));
|
||||
sprintf(s, "%d", tc->tnc_union->integer);
|
||||
return s;
|
||||
case CHARACTER:
|
||||
return getName(chara);
|
||||
s = calloc(2, sizeof(char));
|
||||
sprintf(s, "%c", tc->tnc_union->character);
|
||||
return s;
|
||||
|
Reference in New Issue
Block a user