polserver/pol-core/bscript/compiler/ast/FunctionParameterDeclaration.h
Kevin Eady c286b49858
Fix handling of byref, rest, and default parameters in uninitialized functions (#814)
* Update grammar

* update prettifier

* Update semantic analysis
- Move checks for 'super' and non-static to semantic analyzer
- Add checks for byref and default

* Add, update tests

* update escript guide, add tests for examples in guide

* update core-changes

* Address Discord comments
- Update core-changes to explicitly talk about default parameters
2025-09-06 17:26:06 +02:00

36 lines
1.1 KiB
C++

#ifndef POLSERVER_FUNCTIONPARAMETERDECLARATION_H
#define POLSERVER_FUNCTIONPARAMETERDECLARATION_H
#include "bscript/compiler/ast/Node.h"
#include "bscript/compiler/model/ScopableName.h"
namespace Pol::Bscript::Compiler
{
class NodeVisitor;
class Expression;
class FunctionParameterDeclaration : public Node
{
public:
FunctionParameterDeclaration( const SourceLocation& source_location, ScopableName name,
bool byref, bool unused, bool uninit_default, bool rest,
std::unique_ptr<Expression> default_value );
FunctionParameterDeclaration( const SourceLocation& source_location, ScopableName name,
bool byref, bool unused, bool uninit_default, bool rest );
void accept( NodeVisitor& visitor ) override;
void describe_to( std::string& ) const override;
Expression* default_value();
const ScopableName name;
const bool byref;
const bool unused;
const bool uninit_default;
const bool rest;
};
} // namespace Pol::Bscript::Compiler
#endif // POLSERVER_FUNCTIONPARAMETERDECLARATION_H