Skip to content
Snippets Groups Projects
Commit d44beaa2 authored by Raymond Toy's avatar Raymond Toy
Browse files

Generate a loop error if the variable is not a symbol for the string

codepoint and glyph iterators.
parent 2b1925b6
No related branches found
No related tags found
No related merge requests found
...@@ -2168,6 +2168,8 @@ collected result will be returned as the value of the LOOP." ...@@ -2168,6 +2168,8 @@ collected result will be returned as the value of the LOOP."
(cond ((or (cdr prep-phrases) (not (member (caar prep-phrases) '(:in :of)))) (cond ((or (cdr prep-phrases) (not (member (caar prep-phrases) '(:in :of))))
(loop-error _N"Too many prepositions!")) (loop-error _N"Too many prepositions!"))
((null prep-phrases) (loop-error _N"Missing OF or IN in ~S iteration path."))) ((null prep-phrases) (loop-error _N"Missing OF or IN in ~S iteration path.")))
(unless (symbolp variable)
(loop-error _N"Destructuring is not valid for string codepoint iteration."))
(let ((string-var (loop-gentemp 'loop-codepoint-string-)) (let ((string-var (loop-gentemp 'loop-codepoint-string-))
(next-fn (loop-gentemp 'loop-codepoint-next-)) (next-fn (loop-gentemp 'loop-codepoint-next-))
(post-steps nil)) (post-steps nil))
...@@ -2201,6 +2203,8 @@ collected result will be returned as the value of the LOOP." ...@@ -2201,6 +2203,8 @@ collected result will be returned as the value of the LOOP."
(cond ((or (cdr prep-phrases) (not (member (caar prep-phrases) '(:in :of)))) (cond ((or (cdr prep-phrases) (not (member (caar prep-phrases) '(:in :of))))
(loop-error _N"Too many prepositions!")) (loop-error _N"Too many prepositions!"))
((null prep-phrases) (loop-error _N"Missing OF or IN in ~S iteration path."))) ((null prep-phrases) (loop-error _N"Missing OF or IN in ~S iteration path.")))
(unless (symbolp variable)
(loop-error _N"Destructuring is not valid for string glyph iteration."))
(let ((string-var (loop-gentemp 'loop-glyph-string-)) (let ((string-var (loop-gentemp 'loop-glyph-string-))
(next-fn (loop-gentemp 'loop-glyph-next-)) (next-fn (loop-gentemp 'loop-glyph-next-))
(post-steps nil)) (post-steps nil))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment