Skip to content

Commit e275b49

Browse files
committed
Remove Compiler::breakAtomicScript()
1 parent 3839ffd commit e275b49

File tree

4 files changed

+0
-28
lines changed

4 files changed

+0
-28
lines changed

include/scratchcpp/compiler.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ class LIBSCRATCHCPP_EXPORT Compiler
6262
void addProcedureArg(const std::string &procCode, const std::string &argName);
6363
void moveToSubstack(std::shared_ptr<Block> substack1, std::shared_ptr<Block> substack2, SubstackType type);
6464
void moveToSubstack(std::shared_ptr<Block> substack, SubstackType type);
65-
void breakAtomicScript();
6665
void warp();
6766

6867
Input *input(int id) const;

src/engine/compiler.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ void Compiler::init()
2727

2828
impl->bytecode.clear();
2929
impl->procedurePrototype = nullptr;
30-
impl->atomic = true;
3130
impl->warp = false;
3231

3332
// Add start instruction
@@ -235,16 +234,6 @@ void Compiler::moveToSubstack(std::shared_ptr<Block> substack, SubstackType type
235234
moveToSubstack(substack, nullptr, type);
236235
}
237236

238-
/*!
239-
* Adds the vm::OP_BREAK_ATOMIC instruction at the end of the current loop.
240-
* This can be used for example in motion blocks.
241-
* \note Nothing will happen if the script is set to run without screen refresh.
242-
*/
243-
void Compiler::breakAtomicScript()
244-
{
245-
impl->atomic = false;
246-
}
247-
248237
/*! Makes current script run without screen refresh. */
249238
void Compiler::warp()
250239
{

src/engine/compiler_p.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ struct CompilerPrivate
3636
std::vector<std::string> procedures;
3737
std::unordered_map<std::string, std::vector<std::string>> procedureArgs;
3838
BlockPrototype *procedurePrototype = nullptr;
39-
bool atomic = true;
4039
bool warp = false;
4140
};
4241

test/compiler/compiler_test.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -430,21 +430,6 @@ TEST_F(CompilerTest, AddFunctionCall)
430430
ASSERT_EQ(engine.functionIndex(&testFunction2), 1);
431431
}
432432

433-
TEST_F(CompilerTest, BreakAtomicScript)
434-
{
435-
static const int SUBSTACK = 0;
436-
437-
INIT_COMPILER(engine, compiler);
438-
compiler.addInstruction(vm::OP_START);
439-
440-
compiler.addInstruction(vm::OP_FOREVER_LOOP);
441-
compiler.breakAtomicScript();
442-
compiler.moveToSubstack(nullptr, Compiler::SubstackType::Loop);
443-
444-
compiler.addInstruction(vm::OP_HALT);
445-
ASSERT_EQ(compiler.bytecode(), std::vector<unsigned int>({ vm::OP_START, vm::OP_FOREVER_LOOP, vm::OP_BREAK_ATOMIC, vm::OP_LOOP_END, vm::OP_HALT }));
446-
}
447-
448433
TEST_F(CompilerTest, Warp)
449434
{
450435
INIT_COMPILER(engine, compiler);

0 commit comments

Comments
 (0)