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
6835ff89
Commit
6835ff89
authored
20 years ago
by
emarsden
Browse files
Options
Downloads
Patches
Plain Diff
When compiling from a stream, the compiler can't use FILE-LENGTH on the
string-input-stream. From Luke Gorrie.
parent
dcc2fa17
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/main.lisp
+11
-11
11 additions, 11 deletions
compiler/main.lisp
with
11 additions
and
11 deletions
compiler/main.lisp
+
11
−
11
View file @
6835ff89
...
...
@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/main.lisp,v 1.14
0
2004/0
4/06 20:44:01 rtoy
Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/main.lisp,v 1.14
1
2004/0
5/10 16:58:37 emarsden
Exp $"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -800,12 +800,13 @@ in the user USER-INFO slot of STREAM-SOURCE-LOCATIONs.")
;;; Unexpected-EOF-Error -- Internal
;;;
;;; Print an error message giving some context for an EOF error. We print
;;; the first line after P
os
that contains #\" or #\(, or lacking that, the
;;; the first line after P
OS
that contains #\" or #\(, or lacking that, the
;;; first non-empty line.
;;;
(
defun
unexpected-eof-error
(
stream
pos
condition
)
(
declare
(
type
stream
stream
)
(
type
unsigned-byte
pos
))
(
let
((
res
nil
))
(
let
((
eof-pos
(
file-position
stream
))
(
res
nil
))
(
file-position
stream
pos
)
(
loop
(
let
((
line
(
read-line
stream
nil
nil
)))
...
...
@@ -820,25 +821,24 @@ in the user USER-INFO slot of STREAM-SOURCE-LOCATIONs.")
"Read error in form starting at ~D:~%~@[ \"~A\"~%~]~A"
pos
res
condition
))
(
file-position
stream
(
file-length
stream
)
)
(
file-position
stream
eof-pos
)
(
undefined-value
))
;;; Careful-Read -- Internal
;;;
;;; Read a form from S
tream
, returning EOF at EOF. If a read error happens,
;;; Read a form from S
TREAM
, returning EOF at EOF. If a read error happens,
;;; then attempt to recover if possible, returing a proxy error form.
;;;
(
defun
careful-read
(
stream
eof
pos
)
(
handler-case
(
let
((
*features*
(
backend-features
*target-backend*
)))
(
read
stream
nil
eof
))
(
error
(
condition
)
(
let
((
new-pos
(
file-position
stream
)))
(
cond
((
=
new-pos
(
file-length
stream
))
(
unexpected-eof-error
stream
pos
condition
))
(
t
(
normal-read-error
stream
pos
condition
)
(
ignore-error-form
stream
pos
))))
(
if
(
null
(
peek-char
nil
stream
nil
))
(
unexpected-eof-error
stream
pos
condition
)
(
progn
(
normal-read-error
stream
pos
condition
)
(
ignore-error-form
stream
pos
)))
'
(
cerror
"Skip this form."
"Attempt to load a file having a compile-time read error."
))))
...
...
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