[Scummvm-git-logs] scummvm master -> 277d807168e57fcd83a1fb1dd9fcb11777af6e9e

rvanlaar roland at rolandvanlaar.nl
Tue Feb 18 17:31:52 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
277d807168 DIRECTOR: LINGO: repeat with a in list tests


Commit: 277d807168e57fcd83a1fb1dd9fcb11777af6e9e
    https://github.com/scummvm/scummvm/commit/277d807168e57fcd83a1fb1dd9fcb11777af6e9e
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2020-02-18T18:28:37+01:00

Commit Message:
DIRECTOR: LINGO: repeat with a in list tests

Add three tests:
- exit during repeat with
- return during repeat with
- handle list expr and not a variable in repeat with

The last test is added since it's not supported and breaks
code execution.

Changed paths:
    engines/director/lingo/tests/loops.lingo


diff --git a/engines/director/lingo/tests/loops.lingo b/engines/director/lingo/tests/loops.lingo
index 90d499a..bdf3d52 100644
--- a/engines/director/lingo/tests/loops.lingo
+++ b/engines/director/lingo/tests/loops.lingo
@@ -32,3 +32,34 @@ repeat while y < 5
   if y = 3 then next repeat
   put y
 end repeat
+
+-- tests for repeat with
+
+on exitRepeatWith
+  set aList = [1,2,3,4]
+  repeat with a in aList
+    if a = 3 then
+      exit repeat
+    end if
+  end repeat
+  return a
+end exitRepeatWith
+
+on returnRepeatWith
+  set aList = [1,2,3,4]
+  repeat with a in aList
+    if a = 3 then
+      return a
+    end if
+  end repeat
+end returnRepeatWith
+
+on directListRepeatWith
+  repeat with a in [1,2,3,4]
+    put a
+  end repeat
+end directListRepeatWith
+
+put exitRepeatWith()
+put returnRepeatWith()
+directListRepeatWith()




More information about the Scummvm-git-logs mailing list