Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
de179f4c
Commit
de179f4c
authored
33 years ago
by
ram
Browse files
Options
Downloads
Patches
Plain Diff
Fixed FORMAT transform to warn if there are to many or too few args.
parent
c1c8d68f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
compiler/srctran.lisp
+35
-28
35 additions, 28 deletions
compiler/srctran.lisp
with
35 additions
and
28 deletions
compiler/srctran.lisp
+
35
−
28
View file @
de179f4c
...
...
@@ -7,12 +7,10 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/srctran.lisp,v 1.2
7
1991/0
2/20 14:59:43
ram Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/srctran.lisp,v 1.2
8
1991/0
9/03 17:35:19
ram Exp $"
)
;;;
;;; **********************************************************************
;;;
;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/srctran.lisp,v 1.27 1991/02/20 14:59:43 ram Exp $
;;;
;;; This file contains macro-like source transformations which convert
;;; uses of certain functions into the canonical form desired within the
;;; compiler. ### and other IR1 transforms and stuff. Some code adapted from
...
...
@@ -1398,6 +1396,11 @@
;; Write out the final part of the string.
(
forms
`
(
write-string
,
(
subseq
control
index
end
)
,@
stream-form
))
(
when
args
(
compiler-warning
"~R extra format argument~:P. Ignoring..."
(
length
args
))
(
forms
`
(
progn
,@
args
)))
(
return
`
(
lambda
(
stream
control
,@
arg-vars
)
(
declare
(
ignorable
stream
control
))
,@
(
forms
)
...
...
@@ -1414,30 +1417,34 @@
,@
stream-form
)))
;; Get the format directive.
(
forms
(
case
(
schar
control
(
1+
command-index
))
((
#\b
#\B
)
`
(
let
((
*print-base*
2
))
(
princ
,
(
pop
args
)
,@
stream-form
)))
((
#\o
#\O
)
`
(
let
((
*print-base*
8
))
(
princ
,
(
pop
args
)
,@
stream-form
)))
((
#\d
#\D
)
`
(
let
((
*print-base*
10
))
(
princ
,
(
pop
args
)
,@
stream-form
)))
((
#\x
#\X
)
`
(
let
((
*print-base*
16
))
(
princ
,
(
pop
args
)
,@
stream-form
)))
((
#\a
#\A
)
`
(
princ
,
(
pop
args
)
,@
stream-form
))
((
#\s
#\S
)
`
(
prin1
,
(
pop
args
)
,@
stream-form
))
(
#\%
`
(
terpri
,@
stream-form
))
(
#\&
`
(
fresh-line
,@
stream-form
))
(
#\|
`
(
write-char
#\form
,@
stream-form
))
(
#\~
`
(
write-char
#\~
,@
stream-form
))
(
#\newline
(
let
((
new-pos
(
position-if-not
#'
lisp::whitespace-char-p
control
:start
(
+
command-index
2
))))
(
if
new-pos
(
setq
command-index
(
-
new-pos
2
)))))
(
t
(
give-up
))))
(
flet
((
next-arg
()
(
unless
args
(
abort-transform
"Missing FORMAT argument."
))
(
pop
args
)))
(
forms
(
case
(
schar
control
(
1+
command-index
))
((
#\b
#\B
)
`
(
let
((
*print-base*
2
))
(
princ
,
(
next-arg
)
,@
stream-form
)))
((
#\o
#\O
)
`
(
let
((
*print-base*
8
))
(
princ
,
(
next-arg
)
,@
stream-form
)))
((
#\d
#\D
)
`
(
let
((
*print-base*
10
))
(
princ
,
(
next-arg
)
,@
stream-form
)))
((
#\x
#\X
)
`
(
let
((
*print-base*
16
))
(
princ
,
(
next-arg
)
,@
stream-form
)))
((
#\a
#\A
)
`
(
princ
,
(
next-arg
)
,@
stream-form
))
((
#\s
#\S
)
`
(
prin1
,
(
next-arg
)
,@
stream-form
))
(
#\%
`
(
terpri
,@
stream-form
))
(
#\&
`
(
fresh-line
,@
stream-form
))
(
#\|
`
(
write-char
#\form
,@
stream-form
))
(
#\~
`
(
write-char
#\~
,@
stream-form
))
(
#\newline
(
let
((
new-pos
(
position-if-not
#'
lisp::whitespace-char-p
control
:start
(
+
command-index
2
))))
(
if
new-pos
(
setq
command-index
(
-
new-pos
2
)))))
(
t
(
give-up
)))))
(
setq
index
(
+
command-index
2
)))))))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment