From: Brendan Hansen Date: Wed, 30 Dec 2020 22:52:19 +0000 (-0600) Subject: added very verbose output option, '-VV' X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=e65ba595793794873e7c42ddeb999d81574585b1;p=onyx.git added very verbose output option, '-VV' --- diff --git a/core/string/reader.onyx b/core/string/reader.onyx index b7bc8a7e..2b46d033 100644 --- a/core/string/reader.onyx +++ b/core/string/reader.onyx @@ -3,6 +3,7 @@ package core.string.reader use package core { printf } StringReader :: struct { + // Think of this as `use s : str`; data : ^u8; count : u32; diff --git a/src/onyx.c b/src/onyx.c index b4df7f0a..4df26fb8 100644 --- a/src/onyx.c +++ b/src/onyx.c @@ -47,7 +47,7 @@ typedef struct OnyxCompileOptions { bh_allocator allocator; CompileAction action; - u32 verbose_output : 1; + u32 verbose_output : 2; u32 fun_output : 1; bh_arr(const char *) included_folders; @@ -93,6 +93,9 @@ static OnyxCompileOptions compile_opts_parse(bh_allocator alloc, int argc, char else if (!strcmp(argv[i], "--verbose") || !strcmp(argv[i], "-V")) { options.verbose_output = 1; } + else if (!strcmp(argv[i], "-VV")) { + options.verbose_output = 2; + } else if (!strcmp(argv[i], "--fun") || !strcmp(argv[i], "-F")) { options.fun_output = 1; } @@ -441,6 +444,15 @@ static b32 process_include_entity(CompilerState* compiler_state, Entity* ent) { static b32 process_entity(CompilerState* compiler_state, Entity* ent) { i32 changed = 1; + if (compiler_state->options->verbose_output == 2) { + if (ent->expr && ent->expr->token) + printf("%s | %s:%i:%i\n", + entity_state_strings[ent->state], + ent->expr->token->pos.filename, + ent->expr->token->pos.line, + ent->expr->token->pos.column); + } + switch (ent->state) { case Entity_State_Parse_Builtin: process_include_entity(compiler_state, ent);