Fixing bugs, pointer arithmetic checking, better for, working on first program

This commit is contained in:
Krzosa Karol
2022-06-06 23:50:38 +02:00
parent 729e7aee86
commit f852a23fcb
8 changed files with 127 additions and 50 deletions

View File

@@ -16,20 +16,36 @@ typedef U64 SizeU;
typedef S64 SizeS;
typedef float F32;
typedef double F64;
typedef S32 Bool;
typedef struct String{
U8 *str;
S64 len;
}String;
#define LIT(x) (String){.str=(U8 *)x, .len=sizeof(x)-1}
struct Lex_Stream{
U8 *stream;
U8 *end;
};
void entry();
int main(){
entry();
}
typedef struct Token{
U8 *str;
S64 len;
}Token;
Bool is_numeric(U8 c){
Bool result = ((c>=48)&&(c<=57));
return result;
}
void entry(){
String string_to_lex = LIT("Identifier 2425525 Not_Number");
Token t;
for(S64 i = 0;(i<string_to_lex.len);(i+=1)){
(string_to_lex.str[0]=64);
if(is_numeric((string_to_lex.str[i]))){
(t.str=(&(string_to_lex.str[i])));
for(;is_numeric((string_to_lex.str[i]));){
(i+=1);
}
}
}
}