mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
* Grammar updates - Make class parameters required * Add ClassLink; wip with `super()` calls in ctors * More AST nodes as ScopableNames - (function call) Argument - FunctionParameterDeclaration * Add support for ambiguity handling * Add few more tests * Handle returns in constructors - Semantic analysis to error on returning a value - Introduce specific emitter method for returning from constructor - Various tests * Refactor super building to pre-semantic analysis * Adding several tests, some are TODO - found an issue with function resolver and funcrefs, fix later * Address self-review comments * Fix funcref global func references, tests
27 lines
689 B
C++
27 lines
689 B
C++
#include "ClassLink.h"
|
|
|
|
#include "bscript/compiler/ast/ClassDeclaration.h"
|
|
#include "bscript/compiler/file/SourceLocation.h"
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
{
|
|
ClassLink::ClassLink( const SourceLocation& source_location, std::string name )
|
|
: source_location( source_location ),
|
|
name( std::move( name ) ),
|
|
linked_class_declaration( nullptr )
|
|
{
|
|
}
|
|
|
|
ClassDeclaration* ClassLink::class_declaration() const
|
|
{
|
|
return linked_class_declaration;
|
|
}
|
|
|
|
void ClassLink::link_to( ClassDeclaration* f )
|
|
{
|
|
if ( linked_class_declaration )
|
|
source_location.internal_error( "class declaration already linked" );
|
|
linked_class_declaration = f;
|
|
}
|
|
|
|
} // namespace Pol::Bscript::Compiler
|