chiark
/
gitweb
/
~mdw
/
sod
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7605e37
)
src/module-parse.lisp: Improve error recovery for `load' and `import' items.
author
Mark Wooding
<mdw@distorted.org.uk>
Sun, 26 Mar 2017 14:16:18 +0000
(15:16 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Fri, 8 Jun 2018 18:58:28 +0000
(19:58 +0100)
src/module-parse.lisp
patch
|
blob
|
blame
|
history
diff --git
a/src/module-parse.lisp
b/src/module-parse.lisp
index 014e7e3d0c906a50fb18efa1fb91ab318b9a9833..95196f8aef38ea2691fa716e14f3c077994c32c3 100644
(file)
--- a/
src/module-parse.lisp
+++ b/
src/module-parse.lisp
@@
-140,14
+140,15
@@
(define-pluggable-parser module file (scanner pset)
;; `load' string `;'
(declare (ignore pset))
(flet ((common (name type what thunk)
;; `load' string `;'
(declare (ignore pset))
(flet ((common (name type what thunk)
- (find-file scanner
- (merge-pathnames name
- (make-pathname :type type
- :case :common))
- what
- thunk)))
+ (when name
+ (find-file scanner
+ (merge-pathnames name
+ (make-pathname :type type
+ :case :common))
+ what
+ thunk))))
(with-parser-context (token-scanner-context :scanner scanner)
(with-parser-context (token-scanner-context :scanner scanner)
- (parse (or (seq ("import" (name
:string) #\;
)
+ (parse (or (seq ("import" (name
(must :string)) (nil (must #\;))
)
(common name "SOD" "module"
(lambda (path true)
(handler-case
(common name "SOD" "module"
(lambda (path true)
(handler-case
@@
-160,8
+161,12
@@
(define-pluggable-parser module file (scanner pset)
*module*))))
(file-error (error)
(cerror* "Error reading module ~S: ~A"
*module*))))
(file-error (error)
(cerror* "Error reading module ~S: ~A"
+ path error))
+ (error (error)
+ (cerror* "Unexpected error reading ~
+ module ~S: ~A"
path error))))))
path error))))))
- (seq ("load" (name
:string) #\;
)
+ (seq ("load" (name
(must :string)) (nil (must #\;))
)
(common name "LISP" "Lisp file"
(lambda (path true)
(handler-case
(common name "LISP" "Lisp file"
(lambda (path true)
(handler-case