chiark
/
gitweb
/
~mdw
/
sod
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
src/module-parse.lisp (read-module): Use requested pathname for location.
[sod]
/
src
/
module-parse.lisp
diff --git
a/src/module-parse.lisp
b/src/module-parse.lisp
index 4d4d818a4e1bc29a7262cb0eb174681852ec2f44..f90f360ae61f2dfcecaaf87fadadfedc7cd2ac5b 100644
(file)
--- a/
src/module-parse.lisp
+++ b/
src/module-parse.lisp
@@
-35,7
+35,7
@@
(define-pluggable-parser module typename (scanner pset)
(declare (ignore pset))
(with-parser-context (token-scanner-context :scanner scanner)
(parse (and "typename"
(declare (ignore pset))
(with-parser-context (token-scanner-context :scanner scanner)
(parse (and "typename"
- (skip-many (
:min 1
)
+ (skip-many ()
(seq ((id :id))
(if (gethash id *module-type-map*)
(cerror* "Type `~A' already defined" id)
(seq ((id :id))
(if (gethash id *module-type-map*)
(cerror* "Type `~A' already defined" id)
@@
-103,7
+103,8
@@
(define-module (pathname :location location :truename truename)
(let* ((*readtable* (copy-readtable))
(*package* (find-package '#:sod-user))
(char-scanner (make-instance 'charbuf-scanner
(let* ((*readtable* (copy-readtable))
(*package* (find-package '#:sod-user))
(char-scanner (make-instance 'charbuf-scanner
- :stream f-stream))
+ :stream f-stream
+ :filename (namestring pathname)))
(scanner (make-instance 'sod-token-scanner
:char-scanner char-scanner)))
(with-default-error-location (scanner)
(scanner (make-instance 'sod-token-scanner
:char-scanner char-scanner)))
(with-default-error-location (scanner)
@@
-112,7
+113,9
@@
(define-module (pathname :location location :truename truename)
(parse (skip-many ()
(seq ((pset (parse-property-set scanner))
(nil (error ()
(parse (skip-many ()
(seq ((pset (parse-property-set scanner))
(nil (error ()
- (plug module scanner pset))))
+ (plug module scanner pset)
+ (skip-until (:keep-end nil)
+ #\; #\}))))
(check-unused-properties pset))))
(declare (ignore consumedp))
(unless winp (syntax-error scanner result)))))))))
(check-unused-properties pset))))
(declare (ignore consumedp))
(unless winp (syntax-error scanner result)))))))))
@@
-178,7
+181,7
@@
(define-pluggable-parser module set (scanner pset)
(parse (skip-many (:min 0)
(error (:ignore-unconsumed t)
(parse-property scanner module-pset)
(parse (skip-many (:min 0)
(error (:ignore-unconsumed t)
(parse-property scanner module-pset)
- (skip-until (
:keep-end t
) #\, #\;))
+ (skip-until () #\, #\;))
#\,))))
#\;))))
#\,))))
#\;))))
@@
-351,8
+354,7
@@
(defun parse-class-body (scanner pset name supers)
;; definition; otherwise it might be a message or slot.
(cond ((not (typep type 'c-function-type))
(when (consp name)
;; definition; otherwise it might be a message or slot.
(cond ((not (typep type 'c-function-type))
(when (consp name)
- (cerror*-with-location
- scanner
+ (cerror*
"Method declarations must have function type")
(setf name (cdr name)))
(parse-slot-item sub-pset base-type type name))
"Method declarations must have function type")
(setf name (cdr name)))
(parse-slot-item sub-pset base-type type name))