mirror of
				https://github.com/Ed94/gencpp.git
				synced 2025-11-03 23:36:12 -08:00 
			
		
		
		
	progress on modularizing parser paths
This commit is contained in:
		@@ -25,7 +25,7 @@ ParseInfo wip_parse_str(LexedInfo lexed, ParseOpts* opts)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	_ctx->parser.Tokens = toks;
 | 
						_ctx->parser.Tokens = toks;
 | 
				
			||||||
	push_scope();
 | 
						push_scope();
 | 
				
			||||||
	CodeBody result = parse_global_nspace(CT_Global_Body);
 | 
						CodeBody result = parse_global_nspace(_ctx, CT_Global_Body);
 | 
				
			||||||
	parser_pop(& _ctx->parser);
 | 
						parser_pop(& _ctx->parser);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return info;
 | 
						return info;
 | 
				
			||||||
@@ -41,7 +41,7 @@ CodeClass parse_class( Str def )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	_ctx->parser.Tokens = toks;
 | 
						_ctx->parser.Tokens = toks;
 | 
				
			||||||
	push_scope();
 | 
						push_scope();
 | 
				
			||||||
	CodeClass result = (CodeClass) parse_class_struct( Tok_Decl_Class, parser_not_inplace_def );
 | 
						CodeClass result = (CodeClass) parse_class_struct( _ctx, Tok_Decl_Class, parser_not_inplace_def );
 | 
				
			||||||
	parser_pop(& _ctx->parser);
 | 
						parser_pop(& _ctx->parser);
 | 
				
			||||||
	return result;
 | 
						return result;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -209,7 +209,7 @@ CodeBody parse_global_body( Str def )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	_ctx->parser.Tokens = toks;
 | 
						_ctx->parser.Tokens = toks;
 | 
				
			||||||
	push_scope();
 | 
						push_scope();
 | 
				
			||||||
	CodeBody result = parse_global_nspace( CT_Global_Body );
 | 
						CodeBody result = parse_global_nspace(_ctx, CT_Global_Body );
 | 
				
			||||||
	parser_pop(& _ctx->parser);
 | 
						parser_pop(& _ctx->parser);
 | 
				
			||||||
	return result;
 | 
						return result;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -260,7 +260,7 @@ CodeStruct parse_struct( Str def )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	_ctx->parser.Tokens = toks;
 | 
						_ctx->parser.Tokens = toks;
 | 
				
			||||||
	push_scope();
 | 
						push_scope();
 | 
				
			||||||
	CodeStruct result = (CodeStruct) parse_class_struct( Tok_Decl_Struct, parser_not_inplace_def );
 | 
						CodeStruct result = (CodeStruct) parse_class_struct( _ctx, Tok_Decl_Struct, parser_not_inplace_def );
 | 
				
			||||||
	parser_pop(& _ctx->parser);
 | 
						parser_pop(& _ctx->parser);
 | 
				
			||||||
	return result;
 | 
						return result;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -26,10 +26,8 @@ template <class TType> using TRemovePtr = typename RemovePtr<TType>::Type;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
struct ArrayHeader;
 | 
					struct ArrayHeader;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if GEN_COMPILER_CPP
 | 
					 | 
				
			||||||
template<class Type> struct Array;
 | 
					template<class Type> struct Array;
 | 
				
			||||||
#define get_array_underlying_type(array) typename TRemovePtr<typeof(array)>:: DataType
 | 
					#define get_array_underlying_type(array) typename TRemovePtr<typeof(array)>:: DataType
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
usize array_grow_formula(ssize value);
 | 
					usize array_grow_formula(ssize value);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -59,12 +57,12 @@ struct ArrayHeader {
 | 
				
			|||||||
	usize         Num;
 | 
						usize         Num;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if GEN_COMPILER_CPP
 | 
					 | 
				
			||||||
template<class Type>
 | 
					template<class Type>
 | 
				
			||||||
struct Array
 | 
					struct Array
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	Type* Data;
 | 
						Type* Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if ! GEN_C_LIKE_CPP
 | 
				
			||||||
#pragma region Member Mapping
 | 
					#pragma region Member Mapping
 | 
				
			||||||
	forceinline static Array  init(AllocatorInfo allocator)                         { return array_init<Type>(allocator); }
 | 
						forceinline static Array  init(AllocatorInfo allocator)                         { return array_init<Type>(allocator); }
 | 
				
			||||||
	forceinline static Array  init_reserve(AllocatorInfo allocator, ssize capacity) { return array_init_reserve<Type>(allocator, capacity); }
 | 
						forceinline static Array  init_reserve(AllocatorInfo allocator, ssize capacity) { return array_init_reserve<Type>(allocator, capacity); }
 | 
				
			||||||
@@ -88,6 +86,7 @@ struct Array
 | 
				
			|||||||
	forceinline bool         resize(usize num)                                 { return array_resize<Type>(this, num); }
 | 
						forceinline bool         resize(usize num)                                 { return array_resize<Type>(this, num); }
 | 
				
			||||||
	forceinline bool         set_capacity(usize new_capacity)                  { return array_set_capacity<Type>(this, new_capacity); }
 | 
						forceinline bool         set_capacity(usize new_capacity)                  { return array_set_capacity<Type>(this, new_capacity); }
 | 
				
			||||||
#pragma endregion Member Mapping
 | 
					#pragma endregion Member Mapping
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	forceinline operator Type*()             { return Data; }
 | 
						forceinline operator Type*()             { return Data; }
 | 
				
			||||||
	forceinline operator Type const*() const { return Data; }
 | 
						forceinline operator Type const*() const { return Data; }
 | 
				
			||||||
@@ -99,9 +98,8 @@ struct Array
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	using DataType = Type;
 | 
						using DataType = Type;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if GEN_COMPILER_CPP && 0
 | 
					#if 0
 | 
				
			||||||
template<class Type> bool append(Array<Type>& array, Array<Type> other)                         { return append( & array, other ); }
 | 
					template<class Type> bool append(Array<Type>& array, Array<Type> other)                         { return append( & array, other ); }
 | 
				
			||||||
template<class Type> bool append(Array<Type>& array, Type value)                                { return append( & array, value ); }
 | 
					template<class Type> bool append(Array<Type>& array, Type value)                                { return append( & array, value ); }
 | 
				
			||||||
template<class Type> bool append(Array<Type>& array, Type* items, usize item_num)               { return append( & array, items, item_num ); }
 | 
					template<class Type> bool append(Array<Type>& array, Type* items, usize item_num)               { return append( & array, items, item_num ); }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user