parse_static_assert now properly adds new-line to end of statement.
I'm going to end up making a static_assert ast... that or when the statement ast is made it will handle adding that newline.
Interface adding has been adjusted to use ParentType->Next.
Using the AST_Class->Next was bad since that breaks the linked list a body AST would have used for traversal.
strip_formatting suffers from some edge failure with what looks to be escaped character literals (not entirely sure).
I've decided to not remove formatting from unvalidated function bodies since I plan to support parsing its content properly.
However expression values for a statement will fail to have their formatting removed with this.
Since I don't plan to parse those anytime soon, I'll have to fix any edge cases for those at least..
Need to make the debug_str provided by the AST type aware to provide as much contextual information as possible (finally got to this point with validation).
Singleheader test now directly calls clang-format to cleanup the reconstructed copy of the singleheader. Its needed to remove any sort of formatting discrepancies found by the parser since its sensistive to that for new-lines, etc.
Wanted to make parser implementation easier to sift through, so I emphasized alphabetical order more.
Since I couldn't just strip whitespace from typenames I decided to make the parse_type more aware of the typename's components if it was a function signature.
This ofc lead to the dark & damp hell that is parsing typenames.
Also made initial implementation to support parsing decltype within a typename signature..
The test failure for the singleheader is still a thing, these changes have not addressed that.
Removed whitespace stripping from parse_type, prepped for doing some major changes for function signature typenames
Moved template argument parsing to its own helper function since its used in more the one spot.
Latest failure is due to stack overflow when validating parameters. (Shouldn't be hard to debug)
Made debug for viewing whitespace in AST::is_equal with String::visualize_whitespace()
Format stripping code is currently confined within parse_define()
I plan to move it to its own function soon, I just want to make sure its finalized first.
Other unvalidated content will need to have an extra check for preprocessed lines.
Example: Function bodies can have a #define <identifier> <definition>. I cannot strip the last <new line> as it will break the semantic importance to distinguish that line.
So it needs to be:
<content before> <new line>
<preprocessed line> <new line>
<content after>
In the content string that is minimally preserved
Also now doing comment serialization on def_comment directly as parse_comment doesn't need it.
Essentially comment ast types serialize the same way s untyped and execution ASTs
I need to change it so that they all use one big arena allocation for the initial. This can be done when the global allocator is changed to a growable arena.
This isn't the last step though everything in the main project directory that isn't md files needs to be generated only.
Can't do that till testing is robust enough...
Adding the pragma once and includes the files broke compilation, still diagnosing why.
- Some string functions were moved to the cpp, still need to do some more evaluation of it and the containers...
- Added support for forceinline and neverinline to parsing (untested)
- Added support for specifiers in operator cast such as explicit, inline/forceinline/neverinline, etc.
- Before it only support const.
- Still need to support volatile.
- Forceinline was not supported at all for tokenization, fixed that.
There were multiple issues with comment and newline lexing.
Extended printing functions to support Strings with %S flag (captial 'S').
Allows for length detection. Also made it so that precision for strings is the string length.
Also fix for HashTable<>::rehash_fast not having finished implemenation...
The typedef fix is a sort of hack (like how parsing the rest of the language feels like tbh...).
I might make a def_typedef_fn to make it clearer how to define function typedefs using the upfront interface.
Looking into properly dealing with empty lines...
I want to preserve the text's empty lines in the AST for serialization purposes (perserve formatting for gapes between definitions).
Don't want to introduce the possibility of it breaking though, so will have to ignore empty_lines in a general way (if they are in a bad spot).
Attempted to cover that by having TokArray::current() auto-skip empty lines and eat as well if the type doesn't match.
Isolating large macros to their own directory (components/temp).
- Plan is to remove them soon with proper generation.
Added additional component files, separating the old data_structures header for a set of ast headers.
Header_end also had its inlines extracted out.
Necessary to complete the macro isolation.
ZPL parser dependencies were removed from the core library along with builder, its now generated in bootstrap as pare of making a gen_builder set of files.
Singleheader will be changed in next few commits to reflect this as well (By making builder deps and components a conditional option).
Tests are most likely all broken for now.