mirror of
https://github.com/Ed94/gencpp.git
synced 2025-06-16 19:51:47 -07:00
WIP Broken: Working towards major changes to lexer
Lexer tokens now tracked using TokenSlice. ParserContext as the id for current token during traversal. Last progress on errors needs updates to interface.parsing.cpp Not adding message support yet as that will need to revamped with the logging, right now just focused on getting both lexer on parser to use proper info data structures. Thinking of separating ParseContext from the general lib Context, plan is to just have the parser context have its allocator and other references it needs. So there will seem to be redundant parameter passing to some procedures for now. The big endgoal of this other than the parser's compression is the ability to support mult-threading. Immediate concern other than making sure everything necessary is only within ParseContext, etc is things related to logging, or otherwise that is not thread dependent. Those can get guarded but I don't have full intuition on what will have that (most likely the library's provided allocator/s as well will need guards introduced). I'll concern myself more with charting those out once things are at least lifted properly. Worst case a trivial situation can be achived by the user by just abusing multiple contextes/allocators/etc as we already have in place.
This commit is contained in:
@ -55,6 +55,7 @@ Str loglevel_to_str(LogLevel level)
|
||||
return lookup[level];
|
||||
}
|
||||
|
||||
typedef struct LogEntry LogEntry;
|
||||
struct LogEntry
|
||||
{
|
||||
Str msg;
|
||||
@ -63,6 +64,14 @@ struct LogEntry
|
||||
|
||||
typedef void LoggerProc(LogEntry entry);
|
||||
|
||||
// By default this library will either crash or exit if an error is detected while generating codes.
|
||||
// Even if set to not use GEN_FATAL, GEN_FATAL will still be used for memory failures as the library is unusable when they occur.
|
||||
#ifdef GEN_DONT_USE_FATAL
|
||||
#define log_failure log_fmt
|
||||
#else
|
||||
#define log_failure GEN_FATAL
|
||||
#endif
|
||||
|
||||
enum AccessSpec : u32
|
||||
{
|
||||
AccessSpec_Default,
|
||||
|
Reference in New Issue
Block a user