mirror of
https://github.com/Ed94/gencpp.git
synced 2024-11-10 02:54:53 -08:00
Added refactor.ps1 script, fixed the gencpp.refactor script (missing commas)
This commit is contained in:
parent
88d36f5d06
commit
ebe049d3a0
@ -19,349 +19,349 @@
|
|||||||
// word, namespace, regex
|
// word, namespace, regex
|
||||||
|
|
||||||
// Gen Macro namespace
|
// Gen Macro namespace
|
||||||
// namespace GEN_ new_namespace_
|
// namespace GEN_, new_namespace_
|
||||||
|
|
||||||
// ---------- ZPL Macros
|
// ---------- ZPL Macros
|
||||||
|
|
||||||
// word GEN_ARCH_64_BIT new_name
|
// word GEN_ARCH_64_BIT, new_name
|
||||||
// word GEN_ARCH_32_BIT new_name
|
// word GEN_ARCH_32_BIT, new_name
|
||||||
|
|
||||||
// word GEN_SYSTEM_ANDROID new_name
|
// word GEN_SYSTEM_ANDROID, new_name
|
||||||
// word GEN_SYSTEM_CYGWIN new_name
|
// word GEN_SYSTEM_CYGWIN, new_name
|
||||||
// word GEN_SYSTEM_EMSCRIPTEN new_name
|
// word GEN_SYSTEM_EMSCRIPTEN, new_name
|
||||||
// word GEN_SYSTEM_FREEBSD new_name
|
// word GEN_SYSTEM_FREEBSD, new_name
|
||||||
// word GEN_SYSTEM_IOS new_name
|
// word GEN_SYSTEM_IOS, new_name
|
||||||
// word GEN_SYSTEM_LINUX new_name
|
// word GEN_SYSTEM_LINUX, new_name
|
||||||
// word GEN_SYSTEM_MACOS new_name
|
// word GEN_SYSTEM_MACOS, new_name
|
||||||
// word GEN_SYSTEM_OPENBSD new_name
|
// word GEN_SYSTEM_OPENBSD, new_name
|
||||||
// word GEN_SYSTEM_OSX new_name
|
// word GEN_SYSTEM_OSX, new_name
|
||||||
// word GEN_SYSTEM_UNIX new_name
|
// word GEN_SYSTEM_UNIX, new_name
|
||||||
// word GEN_SYSTEM_WINDOWS new_name
|
// word GEN_SYSTEM_WINDOWS, new_name
|
||||||
|
|
||||||
// word GEN_COMPILER_CLANG new_name
|
// word GEN_COMPILER_CLANG, new_name
|
||||||
// word GEN_COMPILER_GCC new_name
|
// word GEN_COMPILER_GCC, new_name
|
||||||
// word GEN_COMPILER_MINGW new_name
|
// word GEN_COMPILER_MINGW, new_name
|
||||||
// word GEN_COMPILER_MSVC new_name
|
// word GEN_COMPILER_MSVC, new_name
|
||||||
|
|
||||||
// word forceinline new_name
|
// word forceinline, new_name
|
||||||
// word neverinline new_name
|
// word neverinline, new_name
|
||||||
|
|
||||||
// word zpl_cast new_name
|
// word zpl_cast, new_name
|
||||||
|
|
||||||
// word global new_name
|
// word global, new_name
|
||||||
// word internal new_name
|
// word internal, new_name
|
||||||
// word local_persist new_name
|
// word local_persist, new_name
|
||||||
|
|
||||||
// word GEN_DEBUG_TRAP new_name
|
// word GEN_DEBUG_TRAP, new_name
|
||||||
// word GEN_ASSERT new_name
|
// word GEN_ASSERT, new_name
|
||||||
// word GEN_ASSERT_MSG new_name
|
// word GEN_ASSERT_MSG, new_name
|
||||||
// word GEN_ASSERT_NOT_NULL new_name
|
// word GEN_ASSERT_NOT_NULL, new_name
|
||||||
// word GEN_PANIC new_name
|
// word GEN_PANIC, new_name
|
||||||
|
|
||||||
// word zero_item new_name
|
// word zero_item, new_name
|
||||||
// word zero_array new_name
|
// word zero_array, new_name
|
||||||
|
|
||||||
// word alloc_item new_name
|
// word alloc_item, new_name
|
||||||
// word alloc_array new_name
|
// word alloc_array, new_name
|
||||||
|
|
||||||
// word malloc new_name
|
// word malloc, new_name
|
||||||
// word mfree new_name
|
// word mfree, new_name
|
||||||
|
|
||||||
// word count_of new_name
|
// word count_of, new_name
|
||||||
// word is_between new_name
|
// word is_between, new_name
|
||||||
// word min new_name
|
// word min, new_name
|
||||||
// word size_of new_name
|
// word size_of, new_name
|
||||||
// word swap new_name
|
// word swap, new_name
|
||||||
|
|
||||||
// ---------- ZPL Types
|
// ---------- ZPL Types
|
||||||
|
|
||||||
// word b8 new_name
|
// word b8, new_name
|
||||||
// word b16 new_name
|
// word b16, new_name
|
||||||
// word b32 new_name
|
// word b32, new_name
|
||||||
// word s8 new_name
|
// word s8, new_name
|
||||||
// word s16 new_name
|
// word s16, new_name
|
||||||
// word s32 new_name
|
// word s32, new_name
|
||||||
// word s64 new_name
|
// word s64, new_name
|
||||||
// word u8 new_name
|
// word u8, new_name
|
||||||
// word u16 new_name
|
// word u16, new_name
|
||||||
// word u32 new_name
|
// word u32, new_name
|
||||||
// word u64 new_name
|
// word u64, new_name
|
||||||
// word uw new_name
|
// word uw, new_name
|
||||||
// word sw new_name
|
// word sw, new_name
|
||||||
// word sptr new_name
|
// word sptr, new_name
|
||||||
// word uptr new_name
|
// word uptr, new_name
|
||||||
// word f32 new_name
|
// word f32, new_name
|
||||||
// word f64 new_name
|
// word f64, new_name
|
||||||
|
|
||||||
// namespace EAllocator_ new_namespace_
|
// namespace EAllocator_, new_namespace_
|
||||||
// namespace EFileMode_ new_namespace_
|
// namespace EFileMode_, new_namespace_
|
||||||
// namespace EFileError_ new_namespace_
|
// namespace EFileError_, new_namespace_
|
||||||
|
|
||||||
// word AllocatorInfo new_name
|
// word AllocatorInfo, new_name
|
||||||
// word AllocatorProc new_name
|
// word AllocatorProc, new_name
|
||||||
// word AllocFlag new_name
|
// word AllocFlag, new_name
|
||||||
// word AllocType new_name
|
// word AllocType, new_name
|
||||||
// word ArrayHeader new_name
|
// word ArrayHeader, new_name
|
||||||
// word DirEntry new_name
|
// word DirEntry, new_name
|
||||||
// word DirInfo new_name
|
// word DirInfo, new_name
|
||||||
// word DirType new_name
|
// word DirType, new_name
|
||||||
// word FileDescriptor new_name
|
// word FileDescriptor, new_name
|
||||||
// word FileError new_name
|
// word FileError, new_name
|
||||||
// word FileInfo new_name
|
// word FileInfo, new_name
|
||||||
// word FileTime new_name
|
// word FileTime, new_name
|
||||||
// word FileModeFlag new_name
|
// word FileModeFlag, new_name
|
||||||
// word FileOperations new_name
|
// word FileOperations, new_name
|
||||||
// word FileStandardType new_name
|
// word FileStandardType, new_name
|
||||||
// word SeekWhenceType new_name
|
// word SeekWhenceType, new_name
|
||||||
|
|
||||||
// ---------- ZPL Data
|
// ---------- ZPL Data
|
||||||
|
|
||||||
// word default_file_operations new_name
|
// word default_file_operations, new_name
|
||||||
|
|
||||||
// ---------- ZPL Procedures
|
// ---------- ZPL Procedures
|
||||||
|
|
||||||
// word align_forward new_name
|
// word align_forward, new_name
|
||||||
// word align_fordward_i64 new_name
|
// word align_fordward_i64, new_name
|
||||||
// word alloc new_name
|
// word alloc, new_name
|
||||||
// word alloc_align new_name
|
// word alloc_align, new_name
|
||||||
// word assert_handler new_name
|
// word assert_handler, new_name
|
||||||
// word assert_crash new_name
|
// word assert_crash, new_name
|
||||||
// word char_first_occurence new_name
|
// word char_first_occurence, new_name
|
||||||
// word char_is_alpha new_name
|
// word char_is_alpha, new_name
|
||||||
// word char_is_alphanumeric new_name
|
// word char_is_alphanumeric, new_name
|
||||||
// word char_is_digit new_name
|
// word char_is_digit, new_name
|
||||||
// word char_is_hex_digit new_name
|
// word char_is_hex_digit, new_name
|
||||||
// word char_is_space new_name
|
// word char_is_space, new_name
|
||||||
// word char_to_lower new_name
|
// word char_to_lower, new_name
|
||||||
// word char_to_upper new_name
|
// word char_to_upper, new_name
|
||||||
// word crc32 new_name
|
// word crc32, new_name
|
||||||
// word default_resize_align new_name
|
// word default_resize_align, new_name
|
||||||
// word digit_to_int new_name
|
// word digit_to_int, new_name
|
||||||
// word file_close new_name
|
// word file_close, new_name
|
||||||
// word file_get_standard new_name
|
// word file_get_standard, new_name
|
||||||
// word file_name new_name
|
// word file_name, new_name
|
||||||
// word file_open new_name
|
// word file_open, new_name
|
||||||
// word file_open_mode new_name
|
// word file_open_mode, new_name
|
||||||
// word file_seek new_name
|
// word file_seek, new_name
|
||||||
// word file_tell new_name
|
// word file_tell, new_name
|
||||||
// word file_write new_name
|
// word file_write, new_name
|
||||||
// word file_write_at new_name
|
// word file_write_at, new_name
|
||||||
// word file_write_at_check new_name
|
// word file_write_at_check, new_name
|
||||||
// word free new_name
|
// word free, new_name
|
||||||
// word free_all new_name
|
// word free_all, new_name
|
||||||
// word heap new_name
|
// word heap, new_name
|
||||||
// word heap_allocator_proc new_name
|
// word heap_allocator_proc, new_name
|
||||||
// word heap_stats_check new_name
|
// word heap_stats_check, new_name
|
||||||
// word heap_stats_alloc_count new_name
|
// word heap_stats_alloc_count, new_name
|
||||||
// word heap_stats_init new_name
|
// word heap_stats_init, new_name
|
||||||
// word heap_stats_used_memory new_name
|
// word heap_stats_used_memory, new_name
|
||||||
// word hex_digit_to_int new_name
|
// word hex_digit_to_int, new_name
|
||||||
// word i64_to_str new_name
|
// word i64_to_str, new_name
|
||||||
// word is_power_of_two new_name
|
// word is_power_of_two, new_name
|
||||||
// word mem_copy new_name
|
// word mem_copy, new_name
|
||||||
// word mem_move new_name
|
// word mem_move, new_name
|
||||||
// word mem_set new_name
|
// word mem_set, new_name
|
||||||
// word pointer_add new_name
|
// word pointer_add, new_name
|
||||||
// word mem_copy new_name
|
// word mem_copy, new_name
|
||||||
// word mem_find new_name
|
// word mem_find, new_name
|
||||||
// word mem_move new_name
|
// word mem_move, new_name
|
||||||
// word mem_set new_name
|
// word mem_set, new_name
|
||||||
// word resize new_name
|
// word resize, new_name
|
||||||
// word resize_align new_name
|
// word resize_align, new_name
|
||||||
// word process_exit new_name
|
// word process_exit, new_name
|
||||||
// word str_compare new_name
|
// word str_compare, new_name
|
||||||
// word str_copy new_name
|
// word str_copy, new_name
|
||||||
// word str_copy_nulpad new_name
|
// word str_copy_nulpad, new_name
|
||||||
// word str_fmt_buf new_name
|
// word str_fmt_buf, new_name
|
||||||
// word str_fmt_buf_va new_name
|
// word str_fmt_buf_va, new_name
|
||||||
// word str_fmt_file_va new_name
|
// word str_fmt_file_va, new_name
|
||||||
// word str_fmt_out_va new_name
|
// word str_fmt_out_va, new_name
|
||||||
// word str_fmt_out_err new_name
|
// word str_fmt_out_err, new_name
|
||||||
// word str_fmt_out_err_va new_name
|
// word str_fmt_out_err_va, new_name
|
||||||
// word str_fmt_va new_name
|
// word str_fmt_va, new_name
|
||||||
// word str_len new_name
|
// word str_len, new_name
|
||||||
// word str_reverse new_name
|
// word str_reverse, new_name
|
||||||
// word str_to_i64 new_name
|
// word str_to_i64, new_name
|
||||||
// word str_to_lower new_name
|
// word str_to_lower, new_name
|
||||||
// word str_to_upper new_name
|
// word str_to_upper, new_name
|
||||||
// word u64_to_str new_name
|
// word u64_to_str, new_name
|
||||||
// word zero_size new_name
|
// word zero_size, new_name
|
||||||
|
|
||||||
// ---------- gencpp Macros
|
// ---------- gencpp Macros
|
||||||
|
|
||||||
// word bit new_name
|
// word bit, new_name
|
||||||
// word bitfield_is_equal new_name
|
// word bitfield_is_equal, new_name
|
||||||
|
|
||||||
// word ccast new_name
|
// word ccast, new_name
|
||||||
// word pcast new_name
|
// word pcast, new_name
|
||||||
// word rcast new_name
|
// word rcast, new_name
|
||||||
// word scast new_name
|
// word scast, new_name
|
||||||
|
|
||||||
// word do_once new_name
|
// word do_once, new_name
|
||||||
// word do_once_start new_name
|
// word do_once_start, new_name
|
||||||
// word do_once_end new_name
|
// word do_once_end, new_name
|
||||||
// word num_args new_name
|
// word num_args, new_name
|
||||||
// word num_args_impl new_name
|
// word num_args_impl, new_name
|
||||||
// word stringize new_name
|
// word stringize, new_name
|
||||||
// word stringize_va new_name
|
// word stringize_va, new_name
|
||||||
// word txt_StrC new_name
|
// word txt_StrC, new_name
|
||||||
|
|
||||||
// ------------ gencpp common
|
// ------------ gencpp common
|
||||||
|
|
||||||
// word Arena new_name
|
// word Arena, new_name
|
||||||
// word Array new_name
|
// word Array, new_name
|
||||||
// word HashTable new_name
|
// word HashTable, new_name
|
||||||
// word Pool new_name
|
// word Pool, new_name
|
||||||
// word StrC new_name
|
// word StrC, new_name
|
||||||
// word String new_name
|
// word String, new_name
|
||||||
|
|
||||||
// word log_fmt new_name
|
// word log_fmt, new_name
|
||||||
// word fatal new_name
|
// word fatal, new_name
|
||||||
// word to_str new_name
|
// word to_str, new_name
|
||||||
// word to_StrC new_name
|
// word to_StrC, new_name
|
||||||
// word to_type new_name
|
// word to_type, new_name
|
||||||
|
|
||||||
// ------------ gencpp Types & Constants
|
// ------------ gencpp Types & Constants
|
||||||
|
|
||||||
// word LogFailType new_name
|
// word LogFailType, new_name
|
||||||
// word log_failure new_name
|
// word log_failure, new_name
|
||||||
|
|
||||||
// word AccessSpec new_name
|
// word AccessSpec, new_name
|
||||||
// word ECode new_name
|
// word ECode, new_name
|
||||||
// word EnumClass new_name
|
// word EnumClass, new_name
|
||||||
// word EnumRegular new_name
|
// word EnumRegular, new_name
|
||||||
// word EnumT new_name
|
// word EnumT, new_name
|
||||||
// word EOperator new_name
|
// word EOperator, new_name
|
||||||
// word ESpecifier new_name
|
// word ESpecifier, new_name
|
||||||
// word OperatorT new_name
|
// word OperatorT, new_name
|
||||||
// word ModuleFlag new_name
|
// word ModuleFlag, new_name
|
||||||
// word SpecifierT new_name
|
// word SpecifierT, new_name
|
||||||
// word StringCached new_name
|
// word StringCached, new_name
|
||||||
// word StringTable new_name
|
// word StringTable, new_name
|
||||||
// word UsingRegular new_name
|
// word UsingRegular, new_name
|
||||||
// word UsingNamespace new_name
|
// word UsingNamespace, new_name
|
||||||
|
|
||||||
// gencpp Data
|
// ------------ gencpp Data
|
||||||
|
|
||||||
// word API_Export new_name
|
// word API_Export, new_name
|
||||||
// word API_Import new_name
|
// word API_Import, new_name
|
||||||
// word AST_POD_Size new_name
|
// word AST_POD_Size, new_name
|
||||||
// word AST new_name
|
// word AST, new_name
|
||||||
// word AST_POD new_name
|
// word AST_POD, new_name
|
||||||
// word Code new_name
|
// word Code, new_name
|
||||||
// word Code_POD new_name
|
// word Code_POD, new_name
|
||||||
// word Keyword new_name
|
// word Keyword, new_name
|
||||||
// word NoCode new_name
|
// word NoCode, new_name
|
||||||
|
|
||||||
// gencpp API
|
// ------------ gencpp API
|
||||||
|
|
||||||
// word init new_name
|
// word init, new_name
|
||||||
// word deinit new_name
|
// word deinit, new_name
|
||||||
|
|
||||||
// word get_cached_string new_name
|
// word get_cached_string, new_name
|
||||||
// word make_code new_name
|
// word make_code, new_name
|
||||||
// word make_code_entries new_name
|
// word make_code_entries, new_name
|
||||||
|
|
||||||
// word set_allocator_data_arrays new_name
|
// word set_allocator_data_arrays, new_name
|
||||||
// word set_allocator_code_pool new_name
|
// word set_allocator_code_pool, new_name
|
||||||
// word set_allocator_code_entries_arena new_name
|
// word set_allocator_code_entries_arena, new_name
|
||||||
// word set_allocator_string_arena new_name
|
// word set_allocator_string_arena, new_name
|
||||||
// word set_allocator_string_table new_name
|
// word set_allocator_string_table, new_name
|
||||||
// word set_allocator_type_table new_name
|
// word set_allocator_type_table, new_name
|
||||||
|
|
||||||
// upfront constructor namespace
|
// ------------ upfront constructor namespace
|
||||||
// namespace def_ new_namespace_
|
// namespace def_ new_namespace_
|
||||||
|
|
||||||
// upfront constructor individual
|
// ------------ upfront constructor individual
|
||||||
|
|
||||||
// word def_attributes new_name
|
// word def_attributes, new_name
|
||||||
// word def_comment new_name
|
// word def_comment, new_name
|
||||||
// word def_class new_name
|
// word def_class, new_name
|
||||||
// word def_enum new_name
|
// word def_enum, new_name
|
||||||
// word def_execution new_name
|
// word def_execution, new_name
|
||||||
// word def_extern_link new_name
|
// word def_extern_link, new_name
|
||||||
// word def_friend new_name
|
// word def_friend, new_name
|
||||||
// word def_function new_name
|
// word def_function, new_name
|
||||||
// word def_include new_name
|
// word def_include, new_name
|
||||||
// word def_module new_name
|
// word def_module, new_name
|
||||||
// word def_namespace new_name
|
// word def_namespace, new_name
|
||||||
// word def_operator new_name
|
// word def_operator, new_name
|
||||||
// word def_param new_name
|
// word def_param, new_name
|
||||||
// word def_specifier new_name
|
// word def_specifier, new_name
|
||||||
// word def_struct new_name
|
// word def_struct, new_name
|
||||||
// word def_template new_name
|
// word def_template, new_name
|
||||||
// word def_type new_name
|
// word def_type, new_name
|
||||||
// word def_typedef new_name
|
// word def_typedef, new_name
|
||||||
// word def_union new_name
|
// word def_union, new_name
|
||||||
// word def_using new_name
|
// word def_using, new_name
|
||||||
// word def_using_namespace new_name
|
// word def_using_namespace, new_name
|
||||||
// word def_variable new_name
|
// word def_variable, new_name
|
||||||
|
|
||||||
// word def_body new_name
|
// word def_body, new_name
|
||||||
// word def_class_body new_name
|
// word def_class_body, new_name
|
||||||
// word def_enum_body new_name
|
// word def_enum_body, new_name
|
||||||
// word def_export_body new_name
|
// word def_export_body, new_name
|
||||||
// word def_extern_link_body new_name
|
// word def_extern_link_body, new_name
|
||||||
// word def_function_body new_name
|
// word def_function_body, new_name
|
||||||
// word def_global_body new_name
|
// word def_global_body, new_name
|
||||||
// word def_namespace_body new_name
|
// word def_namespace_body, new_name
|
||||||
// word def_params new_name
|
// word def_params, new_name
|
||||||
// word def_specifiers new_name
|
// word def_specifiers, new_name
|
||||||
// word def_struct_body new_name
|
// word def_struct_body, new_name
|
||||||
// word def_union_body new_name
|
// word def_union_body, new_name
|
||||||
|
|
||||||
// parse constructor namespace
|
// ------------ parse constructor namespace
|
||||||
// namespace parse_ new_namespace_
|
// namespace parse_, new_namespace_
|
||||||
|
|
||||||
// parse constructor individual
|
// ------------ parse constructor individual
|
||||||
|
|
||||||
// word parse_class new_name
|
// word parse_class, new_name
|
||||||
// word parse_enum new_name
|
// word parse_enum, new_name
|
||||||
// word parse_export_body new_name
|
// word parse_export_body, new_name
|
||||||
// word parse_extern_link new_name
|
// word parse_extern_link, new_name
|
||||||
// word parse_friend new_name
|
// word parse_friend, new_name
|
||||||
// word parse_function new_name
|
// word parse_function, new_name
|
||||||
// word parse_global_body new_name
|
// word parse_global_body, new_name
|
||||||
// word parse_namespace new_name
|
// word parse_namespace, new_name
|
||||||
// word parse_operator new_name
|
// word parse_operator, new_name
|
||||||
// word parse_struct new_name
|
// word parse_struct, new_name
|
||||||
// word parse_template new_name
|
// word parse_template, new_name
|
||||||
// word parse_type new_name
|
// word parse_type, new_name
|
||||||
// word parse_typedef new_name
|
// word parse_typedef, new_name
|
||||||
// word parse_union new_name
|
// word parse_union, new_name
|
||||||
// word parse_using new_name
|
// word parse_using, new_name
|
||||||
// word parse_variable new_name
|
// word parse_variable, new_name
|
||||||
|
|
||||||
// untyped constructor namespace
|
// ------------ untyped constructor namespace
|
||||||
// namespace untyped_ new_namespace_
|
// namespace untyped_, new_namespace_
|
||||||
|
|
||||||
// untyped constructor individual
|
// ------------ untyped constructor individual
|
||||||
|
|
||||||
// word token_fmt_impl new_name
|
// word token_fmt_impl, new_name
|
||||||
// word token_fmt_va new_name
|
// word token_fmt_va, new_name
|
||||||
// word untyped_str new_name
|
// word untyped_str, new_name
|
||||||
// word untyped_fmt new_name
|
// word untyped_fmt, new_name
|
||||||
// word untyped_token_fmt new_name
|
// word untyped_token_fmt, new_name
|
||||||
|
|
||||||
// File Handling
|
// ------------ File Handling
|
||||||
|
|
||||||
// word Builder new_name
|
// word Builder, new_name
|
||||||
// word Editor new_name
|
// word Editor, new_name
|
||||||
// word Scanner new_name
|
// word Scanner, new_name
|
||||||
|
|
||||||
// gencpp macros
|
// ------------ gencpp macros
|
||||||
|
|
||||||
// word gen_main new_name
|
// word gen_main, new_name
|
||||||
// word GEN_TIME new_name
|
// word GEN_TIME, new_name
|
||||||
|
|
||||||
// word __ new_name
|
// word __, new_name
|
||||||
// word code new_name
|
// word code, new_name
|
||||||
// word name new_name
|
// word name, new_name
|
||||||
// word args new_name
|
// word args, new_name
|
||||||
// word token_fmt new_name
|
// word token_fmt, new_name
|
||||||
|
|
||||||
// Type AST namespace
|
// ------------ Type AST namespace
|
||||||
// namespace t_ new_namespace_
|
// namespace t_, new_namespace_
|
||||||
|
|
||||||
// Specifier AST namespace
|
// ------------ Specifier AST namespace
|
||||||
// namespace spec_ new_namespace_
|
// namespace spec_, new_namespace_
|
||||||
|
53
scripts/refactor.ps1
Normal file
53
scripts/refactor.ps1
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
[string] $format = $false
|
||||||
|
|
||||||
|
foreach ( $arg in $args )
|
||||||
|
{
|
||||||
|
if ( $arg -eq "format" )
|
||||||
|
{
|
||||||
|
$format = $true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[string[]] $include = 'gen.*.hpp', 'gen.*.cpp', 'gen.hpp', 'gen.cpp'
|
||||||
|
[string[]] $exclude
|
||||||
|
|
||||||
|
$path_root = git rev-parse --show-toplevel
|
||||||
|
$path_project = Join-Path $path_root project
|
||||||
|
$path_scripts = Join-Path $path_root scripts
|
||||||
|
$path_singlheader = Join-Path $path_root singleheader
|
||||||
|
$path_singleheader_comp = Join-Path $path_singlheader components
|
||||||
|
|
||||||
|
$file_spec = Join-Path $path_scripts gencpp.refactor
|
||||||
|
|
||||||
|
# Gather the files to be formatted.
|
||||||
|
$targetFiles = @()
|
||||||
|
$targetFiles += Get-ChildItem -Recurse -Path $path_project -Include $include -Exclude $exclude | Select-Object -ExpandProperty FullName
|
||||||
|
$targetFiles += Get-ChildItem -Recurse -Path $path_singleheader_comp -Include $include -Exclude $exclude | Select-Object -ExpandProperty FullName
|
||||||
|
|
||||||
|
# Format the files.
|
||||||
|
$formatParams = @(
|
||||||
|
'-i' # In-place
|
||||||
|
'-style=file:./.clang-format' # Search for a .clang-format file in the parent directory of the source file.
|
||||||
|
'-verbose'
|
||||||
|
)
|
||||||
|
|
||||||
|
write-host "Beginning refactor...`n"
|
||||||
|
|
||||||
|
$refactorParams = @(
|
||||||
|
# "-debug",
|
||||||
|
"-num=$($targetFiles.Count)"
|
||||||
|
"-src=$($targetFiles)",
|
||||||
|
"-spec=$($file_spec)"
|
||||||
|
)
|
||||||
|
|
||||||
|
& refactor $refactorParams
|
||||||
|
|
||||||
|
Write-Host "`nRefactoring complete`n`n"
|
||||||
|
|
||||||
|
if ( $format -eq $true ) {
|
||||||
|
Write-Host "Beginning format...`n"
|
||||||
|
|
||||||
|
& clang-format $formatParams $targetFiles
|
||||||
|
|
||||||
|
Write-Host "`nFormatting complete"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user