Add array accessing

This commit is contained in:
Augusto Gunsch
2020-12-31 16:49:38 -03:00
parent 2e86c2b9e5
commit b9a553b107
8 changed files with 114 additions and 56 deletions

View File

@@ -78,11 +78,12 @@ bool isdotjack(char* f, int len) {
bool isdir(char* f, int len) {
bool readsmt = false;
for(int i = len-1; i >= 0; i--) {
if(f[i] == '.')
if(f[i] == '.') {
if(readsmt)
return false;
else
continue;
}
if(f[i] == '/')
return 1;
readsmt = true;

View File

@@ -14,7 +14,7 @@ CLASS* addclass(const char* name) {
return c;
}
CLASS* adddec(CLASS* c, SUBROUTCLASS subroutclass, char* type, const char* name) {
void adddec(CLASS* c, SUBROUTCLASS subroutclass, char* type, const char* name) {
SUBROUTDEC* dec = (SUBROUTDEC*)malloc(sizeof(SUBROUTDEC));
dec->class = c;
dec->subroutclass = subroutclass;
@@ -151,5 +151,5 @@ SUBROUTDEC* getossubroutdec(SUBROUTCALL* call) {
CLASS* c = getosclass(call->parentname);
if(c == NULL)
return NULL;
getsubroutdecinclass(c, call->name);
return getsubroutdecinclass(c, call->name);
}