about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/loop.c4
-rw-r--r--Test/A01grammar.ztst7
3 files changed, 15 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index fea7b0f76..0f4c36dfc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2020-03-26  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* 45616: Src/loop.c, Test/A01grammar.ztst: Remove tokens
+	from count to repeat keyword.
+
 2020-03-25  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
 	* 45583/0008: Etc/BUGS, Src/utils.c, Test/B13whence.ztst:
diff --git a/Src/loop.c b/Src/loop.c
index 95ef48b33..f13c8c4a9 100644
--- a/Src/loop.c
+++ b/Src/loop.c
@@ -499,8 +499,10 @@ execrepeat(Estate state, UNUSED(int do_exec))
 
     lastval = 0;
     tmp = ecgetstr(state, EC_DUPTOK, &htok);
-    if (htok)
+    if (htok) {
 	singsub(&tmp);
+	untokenize(tmp);
+    }
     count = mathevali(tmp);
     if (errflag)
 	return 1;
diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst
index 0dbf468f6..35a04e7d5 100644
--- a/Test/A01grammar.ztst
+++ b/Test/A01grammar.ztst
@@ -557,6 +557,13 @@
 >Hip hip hooray
 >Hip hip hooray
 
+  repeat 2*2 print yeah
+0:Tokens in repeat argument
+>yeah
+>yeah
+>yeah
+>yeah
+
   case bravo {
     (alpha) print schmalpha
 	    ;;