polserver/pol-core/bscript/compiler/ast/ConstDeclaration.h
Kevin Eady 0fcc5060af
Enum class fixes (#805)
* fix enum classes entries without initializer

* docs

* update grammar to support scoped identifiers in case labels

* add support for enum class constants in case statements

* add ScopableName to ConstDeclaration; formatting fixes; tests

* update docs
2025-08-19 09:07:02 +02:00

32 lines
726 B
C++

#ifndef POLSERVER_CONSTDECLARATION_H
#define POLSERVER_CONSTDECLARATION_H
#include "bscript/compiler/ast/Node.h"
#include "bscript/compiler/model/ScopableName.h"
namespace Pol::Bscript::Compiler
{
class NodeVisitor;
class Expression;
class SourceLocation;
class ConstDeclaration : public Node
{
public:
ScopableName name;
ConstDeclaration( const SourceLocation&, ScopableName name, std::unique_ptr<Expression>,
bool ignore_overwrite_attempt = false );
Expression& expression();
void accept( NodeVisitor& ) override;
void describe_to( std::string& ) const override;
const bool ignore_overwrite_attempt;
};
} // namespace Pol::Bscript::Compiler
#endif // POLSERVER_CONSTDECLARATION_H