mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
28 lines
687 B
C++
28 lines
687 B
C++
#ifndef POLSERVER_BINARYOPERATORWITHSTRINGOPTIMIZER_H
|
|
#define POLSERVER_BINARYOPERATORWITHSTRINGOPTIMIZER_H
|
|
|
|
#include "bscript/compiler/ast/NodeVisitor.h"
|
|
|
|
#include <memory>
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
{
|
|
class Expression;
|
|
|
|
class BinaryOperatorWithStringOptimizer : public NodeVisitor
|
|
{
|
|
public:
|
|
const StringValue& lhs;
|
|
const BinaryOperator& op;
|
|
|
|
std::unique_ptr<Expression> optimized_result;
|
|
|
|
BinaryOperatorWithStringOptimizer( StringValue& lhs, BinaryOperator& op );
|
|
|
|
void visit_children( Node& parent ) override;
|
|
void visit_string_value( StringValue& rhs ) override;
|
|
};
|
|
|
|
} // namespace Pol::Bscript::Compiler
|
|
|
|
#endif // POLSERVER_BINARYOPERATORWITHSTRINGOPTIMIZER_H
|