>From 986181b3b7bd7b6a0814ed45cb606238ab927db3 Mon Sep 17 00:00:00 2001 From: Ian Price Date: Sat, 19 Jan 2013 17:05:27 +0000 Subject: [PATCH] Fix argument count for various format string escape sequences. * module/language/tree-il/analyze.scm (format-string-argument-count): Handle ~t and ~k options case-insensitively. ~! ~| ~/ ~q and ~Q should not update the min-count or max-count. ~^ returns the min-count and 'any --- module/language/tree-il/analyze.scm | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/module/language/tree-il/analyze.scm b/module/language/tree-il/analyze.scm index 88f81f3..29dd876 100644 --- a/module/language/tree-il/analyze.scm +++ b/module/language/tree-il/analyze.scm @@ -1259,7 +1259,7 @@ accurate information is missing from a given `tree-il' element." (case state ((tilde) (case (car chars) - ((#\~ #\% #\& #\t #\_ #\newline #\( #\)) + ((#\~ #\% #\& #\t #\T #\_ #\newline #\( #\) #\! #\| #\/ #\q #\Q) (loop (cdr chars) 'literal '() conditions end-group min-count max-count)) @@ -1330,10 +1330,12 @@ accurate information is missing from a given `tree-il' element." min-count) (+ (or (previous-number params) 1) max-count)))) - ((#\? #\k) + ((#\? #\k #\K) ;; We don't have enough info to determine the exact number ;; of args, but we could determine a lower bound (TODO). (values 'any 'any)) + ((#\^) + (values min-count 'any)) ((#\h #\H) (let ((argc (if (memq #\: params) 2 1))) (loop (cdr chars) 'literal '() -- 1.7.7.6