mirror of
				https://github.com/Ed94/gencpp.git
				synced 2025-10-29 14:00:52 -07:00 
			
		
		
		
	correctionns to gen_unreal_engine
This commit is contained in:
		| @@ -7,7 +7,9 @@ | |||||||
| #include "helpers/helper.hpp" | #include "helpers/helper.hpp" | ||||||
|  |  | ||||||
| GEN_NS_BEGIN | GEN_NS_BEGIN | ||||||
|  | #include "helpers/push_container_defines.inline.hpp" | ||||||
| #include "dependencies/parsing.cpp" | #include "dependencies/parsing.cpp" | ||||||
|  | #include "helpers/pop_container_defines.inline.hpp" | ||||||
| GEN_NS_END | GEN_NS_END | ||||||
|  |  | ||||||
| #include "auxillary/builder.hpp" | #include "auxillary/builder.hpp" | ||||||
| @@ -52,7 +54,7 @@ global bool generate_scanner = true; | |||||||
|  |  | ||||||
| void format_file( char const* path ) | void format_file( char const* path ) | ||||||
| { | { | ||||||
| 	String resolved_path = String::make(GlobalAllocator, to_str(path)); | 	String resolved_path = String::make(GlobalAllocator, to_strc_from_c_str(path)); | ||||||
|  |  | ||||||
| 	String style_arg = String::make(GlobalAllocator, txt("-style=file:")); | 	String style_arg = String::make(GlobalAllocator, txt("-style=file:")); | ||||||
| 	style_arg.append("../scripts/.clang-format "); | 	style_arg.append("../scripts/.clang-format "); | ||||||
| @@ -99,7 +101,7 @@ int gen_main() | |||||||
|  |  | ||||||
| 	// gen_dep.hpp | 	// gen_dep.hpp | ||||||
| 	{ | 	{ | ||||||
| 		CodeBody macros = def_body( CodeT::Global_Body ); | 		CodeBody macros = def_body( CT_Global_Body ); | ||||||
| 		{ | 		{ | ||||||
| 			FileContents content    = file_read_contents( GlobalAllocator, true, project_dir "dependencies/macros.hpp" ); | 			FileContents content    = file_read_contents( GlobalAllocator, true, project_dir "dependencies/macros.hpp" ); | ||||||
| 			CodeBody     ori_macros = parse_global_body( StrC { content.size, (char const*)content.data }); | 			CodeBody     ori_macros = parse_global_body( StrC { content.size, (char const*)content.data }); | ||||||
| @@ -110,10 +112,9 @@ int gen_main() | |||||||
| 			{ | 			{ | ||||||
| 				switch (code->Type) | 				switch (code->Type) | ||||||
| 				{ | 				{ | ||||||
| 					using namespace ECode; | 					case CT_Preprocess_Define: | ||||||
| 					case Preprocess_Define: |  | ||||||
| 					{ | 					{ | ||||||
| 						CodeDefine define = code.cast<CodeDefine>(); | 						CodeDefine define = cast(CodeDefine, code); | ||||||
| 						if ( define->Name.starts_with(txt("global")) ) | 						if ( define->Name.starts_with(txt("global")) ) | ||||||
| 						{ | 						{ | ||||||
| 							macros.append(parse_global_body(txt("#define global // Global variables"))); | 							macros.append(parse_global_body(txt("#define global // Global variables"))); | ||||||
|   | |||||||
| @@ -18,6 +18,8 @@ | |||||||
| // Precedence (highest to lowest): | // Precedence (highest to lowest): | ||||||
| // word, namespace, regex | // word, namespace, regex | ||||||
| 
 | 
 | ||||||
|  | // TODO(ED): THIS IS VERY OUTDATED | ||||||
|  | 
 | ||||||
| // Gen Macro namespace | // Gen Macro namespace | ||||||
| // namespace GEN_, new_namespace_ | // namespace GEN_, new_namespace_ | ||||||
| 
 | 
 | ||||||
| @@ -14,12 +14,11 @@ foreach ( $arg in $args ) | |||||||
| $path_root               = git rev-parse --show-toplevel | $path_root               = git rev-parse --show-toplevel | ||||||
| $path_project            = Join-Path $path_root        project | $path_project            = Join-Path $path_root        project | ||||||
| $path_scripts            = Join-Path $path_root        scripts | $path_scripts            = Join-Path $path_root        scripts | ||||||
| $path_singlheader        = Join-Path $path_root        singleheader | $path_helpers            = Join-Path $path_scripts     helpers | ||||||
| $path_singleheader_comp  = Join-Path $path_singlheader components | $path_unreal             = Join-Path $path_root        gen_unreal_engine | ||||||
| $path_unreal             = Join-Path $path_root        unreal_engine |  | ||||||
| $path_unreal_gen         = Join-Path $path_unreal      gen | $path_unreal_gen         = Join-Path $path_unreal      gen | ||||||
|  |  | ||||||
| $file_spec = Join-Path $path_scripts unreal.refactor | $file_spec = Join-Path $path_unreal unreal.refactor | ||||||
|  |  | ||||||
| # Gather the files to be formatted. | # Gather the files to be formatted. | ||||||
| $targetFiles = @() | $targetFiles = @() | ||||||
| @@ -37,13 +36,14 @@ $formatParams = @( | |||||||
| write-host "Beginning refactor...`n" | write-host "Beginning refactor...`n" | ||||||
|  |  | ||||||
| $refactorParams = @( | $refactorParams = @( | ||||||
|     # "-debug", |     "-debug", | ||||||
|     "-num=$($targetFiles.Count)" |     "-num=$($targetFiles.Count)" | ||||||
|     "-src=$($targetFiles)", |     "-src=$($targetFiles)", | ||||||
|     "-spec=$($file_spec)" |     "-spec=$($file_spec)" | ||||||
| ) | ) | ||||||
|  |  | ||||||
| & refactor $refactorParams | $refactor = join-path $path_helpers refactor.exe | ||||||
|  | & $refactor $refactorParams | ||||||
|  |  | ||||||
| Write-Host "`nRefactoring complete`n`n" | Write-Host "`nRefactoring complete`n`n" | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user