From c4c308c8bafcec4b6c56ce74f143d6a60c14eace Mon Sep 17 00:00:00 2001 From: Ed_ Date: Tue, 29 Aug 2023 00:03:08 -0400 Subject: [PATCH] Fixes for auxilary code + typo fix in ast.cpp Needed the intellisense directive ifdef wrap. --- project/auxillary/builder.cpp | 4 ++- project/auxillary/builder.hpp | 6 ++-- project/auxillary/editor.hpp | 67 ----------------------------------- project/auxillary/scanner.hpp | 7 ++-- project/components/ast.cpp | 2 +- 5 files changed, 12 insertions(+), 74 deletions(-) delete mode 100644 project/auxillary/editor.hpp diff --git a/project/auxillary/builder.cpp b/project/auxillary/builder.cpp index 0ba2a7b..d0ca76d 100644 --- a/project/auxillary/builder.cpp +++ b/project/auxillary/builder.cpp @@ -1,4 +1,6 @@ -#include "builder.hpp" +#ifdef GEN_INTELLISENSE_DIRECTIVES +# include "builder.hpp" +#endif Builder Builder::open( char const* path ) { diff --git a/project/auxillary/builder.hpp b/project/auxillary/builder.hpp index ecb459a..4c4eb1c 100644 --- a/project/auxillary/builder.hpp +++ b/project/auxillary/builder.hpp @@ -1,5 +1,7 @@ -#pragma once -#include "gen.hpp" +#ifdef GEN_INTELLISENSE_DIRECTIVES +# pragma once +# include "gen.hpp" +#endif struct Builder { diff --git a/project/auxillary/editor.hpp b/project/auxillary/editor.hpp deleted file mode 100644 index c8eae23..0000000 --- a/project/auxillary/editor.hpp +++ /dev/null @@ -1,67 +0,0 @@ -#pragma once -#include "gen.scanner.hpp" - -struct Policy -{ - // Nothing for now. -}; - -enum class SymbolType : u32 -{ - Code, - Line, - Marker -}; - -struct Editor -{ - enum RequestType : u32 - { - Add, - Replace, - Remove - }; - - struct SymbolData - { - Policy Policy; - SymbolInfo Info; - }; - - struct RequestEntry - { - union { - SymbolData Symbol; - String Specification; - }; - RequestType Type; - }; - - struct Receipt - { - StringCached File; - Code Found; - Code Written; - bool Result; - }; - - static AllocatorInfo Allocator; - - static void set_allocator( AllocatorInfo allocator ); - - Array Files; - String Buffer; - Array Requests; - - void add_files( s32 num, char const** files ); - - void add ( SymbolInfo definition, Policy policy, Code to_inject ); - void remove ( SymbolInfo definition, Policy policy ); - void replace( SymbolInfo definition, Policy policy, Code to_replace); - -# ifdef GEN_FEATURE_EDITOR_REFACTOR - void refactor( char const* file_path, char const* specification_path ); -# endif - - bool process_requests( Array out_receipts ); -}; diff --git a/project/auxillary/scanner.hpp b/project/auxillary/scanner.hpp index 6bdffa8..5bc60d5 100644 --- a/project/auxillary/scanner.hpp +++ b/project/auxillary/scanner.hpp @@ -1,6 +1,7 @@ - -#pragma once -#include "gen.hpp" +#ifdef GEN_INTELLISENSE_DIRECTIVES +# pragma once +# include "gen.hpp" +#endif // This is a simple file reader that reads the entire file into memory. // It has an extra option to skip the first few lines for undesired includes. diff --git a/project/components/ast.cpp b/project/components/ast.cpp index 804d3f3..b5e1866 100644 --- a/project/components/ast.cpp +++ b/project/components/ast.cpp @@ -1,4 +1,4 @@ -#if GEN_INTELLISENSE_DIRECTIVES +#ifdef GEN_INTELLISENSE_DIRECTIVES #pragma once #include "static_data.cpp" #endif