Convert tables to STRINGARRAY

This commit is contained in:
Augusto Gunsch
2020-12-22 16:00:49 -03:00
parent abef39c1c6
commit 2e48e42368
5 changed files with 14 additions and 14 deletions

View File

@@ -3,7 +3,6 @@
#include <string.h>
#include "parser.h"
#define mkstrlist(name, array) STRINGARRAY name = { .items = array, .size = strcount(array) }
#define next(parser) parser->current = p->current->next
#define anchorparser(parser) p->checkpoint = p->current
#define rewindparser(parser) p->current = p->checkpoint

View File

@@ -111,7 +111,12 @@ SUBROUTDEC* parsesubroutdec(PARSER* p) {
SUBROUTDEC* subroutdec = (SUBROUTDEC*)malloc(sizeof(SUBROUTDEC));
subroutdec->subroutclass = subroutclass;
subroutdec->type = parsetype(p);
if(differs(p, "void"))
subroutdec->type = parsetype(p);
else {
subroutdec->type = p->current->token;
next(p);
}
subroutdec->debug = getdebug(p);