Add ecompile flag -Z to print AST (#796)

* Add -Z option to print string tree

* Simple test to print an AST

* Make CompiledScript owner of the tree

* some refactoring
- rename ecompile.cfg option
- rename AST generator class

* core-changes, docs

* fix warnings
This commit is contained in:
Kevin Eady 2025-07-23 23:00:34 +02:00 committed by GitHub
parent 599000d467
commit 87e0c534f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 150 additions and 15 deletions

View file

@ -0,0 +1,15 @@
#include "AbstractSyntaxTreeStringGenerator.h"
#include "bscript/compiler/ast/Node.h"
#include "bscript/compiler/file/SourceFileIdentifier.h"
namespace Pol::Bscript::Compiler
{
AbstractSyntaxTreeStringGenerator::AbstractSyntaxTreeStringGenerator() {}
void AbstractSyntaxTreeStringGenerator::visit_children( Node& parent )
{
if ( parent.source_location.source_file_identifier->index == 0 )
_tree += parent.to_string_tree();
}
} // namespace Pol::Bscript::Compiler