fixed compilation errors

This commit is contained in:
timerix 2023-01-15 22:01:20 +06:00
parent f820da09d0
commit a53b848933
6 changed files with 9 additions and 20 deletions

View File

@ -18,7 +18,6 @@ OUTDIR=bin
OBJDIR=obj
EXEC_FILE=cb2c.com
case $TASK in
build_exec)
C_ARGS="-O2"

View File

@ -1,8 +1,6 @@
#include "lexer.h"
void ktDescriptors_initCbLexerTypes(){
kt_register(Token, ktId_Token, NULL, NULL);
kt_register(Token*, ktId_TokenPtr, NULL, NULL);
kt_register(Autoarr_Token, ktId_AutoarrToken, ____Autoarr_free_Token, NULL);
kt_register(Autoarr_Token*, ktId_AutoarrTokenPtr, ____Autoarr_free_Token, NULL);
kt_register(Token, NULL, NULL);
kt_register(Autoarr_Token, ____Autoarr_free_Token, NULL);
}

View File

@ -80,7 +80,7 @@ Maybe _readString(char quotChar, SharedLexerData* sld){
else { // "
string str={srcFirst, source-srcFirst+1};
char* extracted=string_extract(str);
return SUCCESS(UniHeap(ktId_CharPtr, extracted));
return SUCCESS(UniHeapPtr(char, extracted));
}
}
else prevIsBackslash= c=='\\' && !prevIsBackslash;
@ -255,7 +255,7 @@ Maybe _lexan(SharedLexerData* sld){
break;
}
return SUCCESS(UniHeap(ktId_AutoarrTokenPtr,tokens));
return SUCCESS(UniHeapPtr(Autoarr(Token), tokens));
}

View File

@ -1,11 +1,7 @@
#include "tokens.h"
ktId_define(ktId_Token);
ktId_define(ktId_TokenPtr);
ktid_define(Token);
Autoarr_define(Token)
ktId_define(ktId_AutoarrToken);
ktId_define(ktId_AutoarrTokenPtr);
STNode* keywordsSearchTree=NULL;
@ -13,7 +9,7 @@ void init_keywordsSearchTree(){
keywordsSearchTree=STNode_create();
for(TokenId keywordId=0; keywordId<=tok_typeof; keywordId++){
const Token* keywordptr=&default_tokens[keywordId];
Unitype uni=UniStack(ktId_TokenPtr, keywordptr);
Unitype uni=UniStackPtr(Token, keywordptr);
ST_push(keywordsSearchTree, keywordptr->value, uni);
}
}

View File

@ -103,12 +103,8 @@ typedef struct Token{
char* value;
TokenId id;
} Token;
ktId_declare(ktId_Token);
ktId_declare(ktId_TokenPtr);
ktid_declare(Token);
Autoarr_declare(Token)
ktId_declare(ktId_AutoarrToken);
ktId_declare(ktId_AutoarrTokenPtr);
extern STNode* keywordsSearchTree;
// dont forget to free it