Skip to content

Commit

Permalink
Fix bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
feeley committed Oct 18, 2023
1 parent 556a884 commit e51702f
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 7 deletions.
4 changes: 2 additions & 2 deletions gsc/_gsclib.scm
Expand Up @@ -74,7 +74,7 @@
expression
(##make-source
expression
(##make-locat (##path->container filename) 0 #f))))))
(**make-locat (##path->container filename) 0 #f))))))
(cond ((##not (or (##null? opts)
(##pair? opts)))
(error "list expected for options: parameter")) ;;;;;;;
Expand Down Expand Up @@ -230,7 +230,7 @@
expression
(##make-source
expression
(##make-locat (##path->container filename) 0 #f))))))
(**make-locat (##path->container filename) 0 #f))))))
(cond ((##not (or (##null? opts)
(##pair? opts)))
(error "list expected for options: parameter")) ;;;;;;;
Expand Down
33 changes: 32 additions & 1 deletion gsc/_host.scm
Expand Up @@ -815,8 +815,39 @@
(define (format-filepos path filepos pinpoint?)
(##format-filepos path filepos pinpoint?))

;; TODO: remove after bootstrap
(define (**make-locat container start-position end-position)
(if end-position
(vector container start-position end-position)
(vector container start-position)))

;; TODO: remove after bootstrap
(define (**locat-start-position locat)
(let ((container (vector-ref locat 0)))
(if (##source? container)
(**locat-start-position (source-locat container))
(vector-ref locat 1))))

;; TODO: remove after bootstrap
(define (**locat-end-position locat)
(let ((container (vector-ref locat 0)))
(if (##source? container)
(**locat-end-position (source-locat container))
(and (= (vector-length locat) 3)
(vector-ref locat 2)))))

(define (**display-message-with-locat gen-message locat kind proc port)
(##display-message-with-locat gen-message locat kind proc port))
(let ((dmwl
(##global-var-ref
(##make-global-var '##display-message-with-locat))))
(if (##unbound? dmwl) ;; TODO: remove after bootstrap
(begin
(display "*** " port)
(display kind port)
(locat-show " IN " locat port)
(display " -- " port)
(gen-message port))
(dmwl gen-message locat kind proc port))))

;; The path functions are already defined by Gambit
;;(define path-expand path-expand)
Expand Down
8 changes: 4 additions & 4 deletions gsc/_source.scm
Expand Up @@ -164,7 +164,7 @@
(if loc

(let ((filename (##container->path (##locat-container loc)))
(filepos (##locat-start-position loc)))
(filepos (**locat-start-position loc)))
(if (string? filename) ; file?
(let ((str (format-filepos filename filepos #t)))
(if str
Expand Down Expand Up @@ -196,7 +196,7 @@
(let* ((container (##locat-container loc))
(path (##container->path container)))
(if path
(let* ((position (##locat-start-position loc))
(let* ((position (**locat-start-position loc))
(filepos (##position->filepos position))
(line (+ (**filepos-line filepos) 1)))
(cons path line))
Expand Down Expand Up @@ -392,7 +392,7 @@
(##current-readtable)
(lambda (re x)
(make-source x
(##make-locat (##port-name (macro-readenv-port re))
(**make-locat (##port-name (macro-readenv-port re))
(##filepos->position
(macro-readenv-filepos re))
(##filepos->position
Expand Down Expand Up @@ -427,7 +427,7 @@
(if (source? x)
x
(let ((locat
(##make-locat container
(**make-locat container
(##filepos->position
(macro-readenv-filepos re))
(##filepos->position
Expand Down
3 changes: 3 additions & 0 deletions gsc/fixnum.scm
Expand Up @@ -26,6 +26,8 @@
**comply-to-standard-scheme?
**display-message-with-locat
**in-new-compilation-ctx
**locat-start-position ;; TODO: remove after bootstrap
**locat-end-position ;; TODO: remove after bootstrap
**macro-compilation-ctx-demand-modules
**macro-compilation-ctx-meta-info
**macro-compilation-ctx-supply-modules
Expand All @@ -34,6 +36,7 @@
**macro-descr-expander
**macro-descr-size
**main-readtable ;; variable
**make-locat ;; TODO: remove after bootstrap
**make-macro-descr
**meta-info->alist
absent-object
Expand Down

0 comments on commit e51702f

Please sign in to comment.