>From f479d801659708d04bf23d26bc81600d68282e18 Mon Sep 17 00:00:00 2001 From: Ian Price Date: Sat, 19 Jan 2013 17:40:24 +0000 Subject: [PATCH] Fix escape sequence parameter handling in format-string-argument-count * module/language/tree-il/analyze.scm (format-string-argument-count): + - # and ' should not increase the argument count. --- module/language/tree-il/analyze.scm | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/module/language/tree-il/analyze.scm b/module/language/tree-il/analyze.scm index 29dd876..badce9f 100644 --- a/module/language/tree-il/analyze.scm +++ b/module/language/tree-il/analyze.scm @@ -1263,7 +1263,7 @@ accurate information is missing from a given `tree-il' element." (loop (cdr chars) 'literal '() conditions end-group min-count max-count)) - ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\, #\: #\@) + ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\, #\: #\@ #\+ #\- #\#) (loop (cdr chars) 'tilde (cons (car chars) params) conditions end-group @@ -1342,6 +1342,11 @@ accurate information is missing from a given `tree-il' element." conditions end-group (+ argc min-count) (+ argc max-count)))) + ((#\') + (if (null? (cdr chars)) + (throw &syntax-error 'unexpected-termination) + (loop (cddr chars) 'tilde (cons (cadr chars) params) + conditions end-group min-count max-count))) (else (loop (cdr chars) 'literal '() conditions end-group (+ 1 min-count) (+ 1 max-count))))) -- 1.7.7.6