File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,7 @@ class LIBSCRATCHCPP_EXPORT Compiler
148
148
149
149
void createYield ();
150
150
void createStop ();
151
+ void createStopWithoutSync ();
151
152
152
153
void createProcedureCall (BlockPrototype *prototype, const Compiler::Args &args);
153
154
Original file line number Diff line number Diff line change @@ -705,6 +705,16 @@ void Compiler::createStop()
705
705
impl->builder ->createStop ();
706
706
}
707
707
708
+ /* !
709
+ * Creates a stop script without synchronization instruction.\n
710
+ * Use this if synchronization is not possible at the stop point.
711
+ * \note Only use this when everything is synchronized, e. g. after a function call.
712
+ */
713
+ void Compiler::createStopWithoutSync ()
714
+ {
715
+ impl->builder ->createStopWithoutSync ();
716
+ }
717
+
708
718
/* ! Creates a call to the procedure with the given prototype. */
709
719
void Compiler::createProcedureCall (BlockPrototype *prototype, const libscratchcpp::Compiler::Args &args)
710
720
{
Original file line number Diff line number Diff line change @@ -1673,6 +1673,20 @@ TEST_F(CompilerTest, CreateStop)
1673
1673
compile (m_compiler.get (), block.get ());
1674
1674
}
1675
1675
1676
+ TEST_F (CompilerTest, CreateStopWithoutSync)
1677
+ {
1678
+
1679
+ auto block = std::make_shared<Block>(" " , " " );
1680
+
1681
+ block->setCompileFunction ([](Compiler *compiler) -> CompilerValue * {
1682
+ EXPECT_CALL (*m_builder, createStopWithoutSync ());
1683
+ compiler->createStopWithoutSync ();
1684
+ return nullptr ;
1685
+ });
1686
+
1687
+ compile (m_compiler.get (), block.get ());
1688
+ }
1689
+
1676
1690
TEST_F (CompilerTest, CreateProcedureCall)
1677
1691
{
1678
1692
You can’t perform that action at this time.
0 commit comments