mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
* compile time optimization: int with doubles and strings doubles with ints and strings strings with ints and doubles * bool with other types, more unary ops, float branch optimizer * more tests fixed bool to dbl compare * output cleanup more tests * optimize string values in if statements, optimize ternary operator * optimize elvis, addes missing files, code cleanup * use array to keep unoptimized if branch in funcexpr tests * missing include * better readable testdata * removed file * optimize while and dowhile loops if predicate is a compile time known value * cleaner variant of loop optimization? * added ConstantPredicateLoop Node used by the optimizer for constant loop predicates optimize repeat until loop change tests to run the loops more then once to be sure they work correctly * test break/continue with label for constant-loop * docs
27 lines
631 B
C++
27 lines
631 B
C++
#ifndef POLSERVER_DOWHILELOOP_H
|
|
#define POLSERVER_DOWHILELOOP_H
|
|
|
|
#include "bscript/compiler/ast/LoopStatement.h"
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
{
|
|
class Block;
|
|
class Expression;
|
|
|
|
class DoWhileLoop : public LoopStatement
|
|
{
|
|
public:
|
|
DoWhileLoop( const SourceLocation& source_location, std::string label, std::unique_ptr<Block>,
|
|
std::unique_ptr<Expression> );
|
|
|
|
void accept( NodeVisitor& ) override;
|
|
void describe_to( std::string& ) const override;
|
|
|
|
Block& block();
|
|
Expression& predicate();
|
|
std::unique_ptr<Block> take_block();
|
|
};
|
|
|
|
} // namespace Pol::Bscript::Compiler
|
|
|
|
#endif // POLSERVER_DOWHILELOOP_H
|