Lines lexed statistic

This commit is contained in:
Krzosa Karol
2023-04-16 14:38:41 +02:00
parent 9b035e85af
commit a2662d1cd8
4 changed files with 4 additions and 8 deletions

View File

@@ -103,7 +103,6 @@ for i in meta.token_simple_expr:
// Init types
pctx->type__void = {TYPE_VOID};
// pctx->type__string = {TYPE_STRING, sizeof(String), __alignof(String)};
pctx->type__bool = {TYPE_BOOL, sizeof(bool), __alignof(bool)};
pctx->type__type = {TYPE_TYPE, sizeof(S64), __alignof(S64)};
@@ -132,6 +131,7 @@ for i in meta.token_simple_expr:
pctx->type_int = &pctx->type__int;
pctx->type_void = &pctx->type__void;
// pctx->type__string = {TYPE_STRING, sizeof(String), __alignof(String)};
// pctx->type_any; // Needs to be inited at runtime
pctx->type_type = &pctx->type__type;

View File

@@ -70,6 +70,7 @@ struct Core_Ctx {
F64 start;
} time;
int lines_lexed;
bool debugger_break_on_compiler_error;

View File

@@ -696,6 +696,7 @@ lex_restream(Core_Ctx *lexer, String istream, String file) {
lexer->stream.indent_stack.allocator = lexer->scratch;
lexer->stream.indent_stack.add(&lexer->same_scope_token);
lex__stream(lexer);
lexer->lines_lexed += lexer->stream.line;
}
//-----------------------------------------------------------------------------

View File

@@ -63,11 +63,6 @@ In the future
- [ ] Basic
- [ ] Detecting if return was called
- [ ] Builtin data structures
- [ ] Some way to take slice of data
- [ ] Dynamic arrays
- [ ] Hash tables
- [ ] Programming constructs
- [ ] Using language construct
- [ ] Named loops and breaking out of them
@@ -77,8 +72,6 @@ In the future
- [ ] Interpreter
- [ ] Code generation
- [ ] Parametric Polymorphism
Ideas
- [ ] #test construct that would gather all tests and run them on start of program or something
- [ ] Inject stack traces into the program
@@ -132,6 +125,7 @@ static void compile_file(Allocator *allocator, String filename, U32 compile_flag
printf("parsing = %f\n", pctx->time.parsing);
printf("typecheck = %f\n", pctx->time.typechecking);
printf("generatin = %f\n", pctx->time.code_generation);
printf("lines lexed= %d\n", pctx->lines_lexed);
}
if (is_flag_set(compile_flags, COMPILE_PRINT_ALLOCATOR_STATS_BEFORE_DESTROY)) {