Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prefix parameter v should be case insensitive #841

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions mats/format.ms
Original file line number Diff line number Diff line change
Expand Up @@ -1461,8 +1461,10 @@

(mat format-slib17 ; variable parameter
(equal? (format "~va" 10 "abc") "abc ")
(equal? (format "~Va" 10 "abc") "abc ") ; Let's test uppercase V too.
; changed 42 to #\* below
(equal? (format "~v,,,va" 10 #\* "abc") "abc*******")
(equal? (format "~V,,,Va" 10 #\* "abc") "abc*******") ; Let's test uppercase V too.
)

(mat format-slib18 ; number of remaining arguments as parameter
Expand Down
4 changes: 2 additions & 2 deletions s/format.ss
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
[(#\,) (state s4-comma () (fx+ i 1) b '(#f))]
[(#\') (state s4-quote () (fx+ i 1) b '())]
[(#\#) (state s4-after-param () (fx+ i 1) b '(hash))]
[(#\v) (state s4-after-param ([nargs (bump nargs 1)]) (fx+ i 1) b '(v))]
[(#\v #\V) (state s4-after-param ([nargs (bump nargs 1)]) (fx+ i 1) b '(v))]
[else (state s5 () i b '())]))))
(define s4-sign
(state lambda (i b p* bp)
Expand Down Expand Up @@ -253,7 +253,7 @@
[(#\,) (state s4-comma () (fx+ i 1) b (cons #f p*))]
[(#\') (state s4-quote () (fx+ i 1) b p*)]
[(#\#) (state s4-after-param () (fx+ i 1) b (cons 'hash p*))]
[(#\v) (state s4-after-param ([nargs (bump nargs 1)]) (fx+ i 1) b (cons 'v p*))]
[(#\v #\V) (state s4-after-param ([nargs (bump nargs 1)]) (fx+ i 1) b (cons 'v p*))]
[else (state s5 () i b (reverse (cons #f p*)))]))))
(define s5
(state lambda (i b p*)
Expand Down