Large updates to docs

This commit is contained in:
2024-12-10 19:31:50 -05:00
parent a18b5b97aa
commit 8891657eb1
20 changed files with 344 additions and 196 deletions

View File

@ -240,22 +240,22 @@ void init()
}
if (Allocator_DataArrays.Proc == nullptr) {
Allocator_DataArrays = heap();
Allocator_DataArrays = GlobalAllocator;
}
if (Allocator_CodePool.Proc == nullptr ) {
Allocator_CodePool = heap();
Allocator_CodePool = GlobalAllocator;
}
if (Allocator_Lexer.Proc == nullptr) {
Allocator_Lexer = heap();
Allocator_Lexer = GlobalAllocator;
}
if (Allocator_StringArena.Proc == nullptr) {
Allocator_StringArena = heap();
Allocator_StringArena = GlobalAllocator;
}
if (Allocator_StringTable.Proc == nullptr) {
Allocator_StringTable = heap();
Allocator_StringTable = GlobalAllocator;
}
if (Allocator_TypeTable.Proc == nullptr) {
Allocator_TypeTable = heap();
Allocator_TypeTable = GlobalAllocator;
}
// Setup the arrays

View File

@ -60,7 +60,7 @@ struct Opts_def_struct {
s32 num_interfaces;
ModuleFlag mflags;
};
CodeClass def_class( StrC name, Opts_def_struct otps GEN_PARAM_DEFAULT );
CodeClass def_class( StrC name, Opts_def_struct opts GEN_PARAM_DEFAULT );
struct Opts_def_constructor {
CodeParam params;
@ -69,7 +69,10 @@ struct Opts_def_constructor {
};
CodeConstructor def_constructor( Opts_def_constructor opts GEN_PARAM_DEFAULT );
CodeDefine def_define( StrC name, StrC content );
struct Opts_def_define {
b32 dont_append_preprocess_defines;
};
CodeDefine def_define( StrC name, StrC content, Opts_def_define opts GEN_PARAM_DEFAULT );
struct Opts_def_destructor {
Code body;

View File

@ -8,6 +8,8 @@
// Publically Exposed Interface
void parser_define_macro( StrC )
CodeClass parse_class( StrC def )
{
GEN_USING_NS_PARSER;

View File

@ -417,7 +417,6 @@ OpValidateResult operator__validate( Operator op, CodeParam params_code, CodeTyp
return InvalidCode;
#pragma endregion Helper Marcos
/*
The implementaiton of the upfront constructors involves doing three things:
* Validate the arguments given to construct the intended type of AST is valid.
@ -616,7 +615,7 @@ CodeClass def_class( StrC name, Opts_def_struct p )
return result;
}
CodeDefine def_define( StrC name, StrC content )
CodeDefine def_define( StrC name, StrC content, Opts_def_define p )
{
name_check( def_define, name );
@ -640,6 +639,17 @@ CodeDefine def_define( StrC name, StrC content )
else
result->Content = get_cached_string( string_to_strc(string_fmt_buf(GlobalAllocator, "%SC\n", content)) );
b32 append_preprocess_defines = ! p.dont_append_preprocess_defines;
if ( append_preprocess_defines ) {
// Add the define to PreprocessorDefines for usage in parsing
s32 lex_id_len = 0;
for (; lex_id_len < result->Name.Len; ++ lex_id_len ) {
if ( reuslt->Name.Ptr[lex_id_len] == '(' )
break;
}
StrC lex_id = { lex_id_len, result->Name.Ptr };
array_append(PreprocessorDefines, lex_id );
}
return result;
}

View File

@ -1,6 +1,6 @@
#ifdef GEN_INTELLISENSE_DIRECTIVES
#pragma once
#include "gen.hpp"
#include "../gen.hpp"
#endif
#pragma region StaticData