summaryrefslogtreecommitdiff
path: root/scheme/chibi/geiser/geiser.scm
diff options
context:
space:
mode:
authorLockywolf <lockywolf@gmail.com>2019-08-06 00:43:05 +0800
committerLockywolf <lockywolf@gmail.com>2019-08-06 00:43:05 +0800
commit1881db7de8c1a0b2d2544dca8b755c6792c916c9 (patch)
tree96d97a74b33bae5c4e350545e5f0fd5e22fe4218 /scheme/chibi/geiser/geiser.scm
parentfbdfbee56a03a1a0396d61fdc8f0b0af87273fc9 (diff)
downloadgeiser-guile-1881db7de8c1a0b2d2544dca8b755c6792c916c9.tar.gz
geiser-guile-1881db7de8c1a0b2d2544dca8b755c6792c916c9.tar.bz2
Add scheme subroutine to find files implementing modules to chibi.
Add a helper function make-location to chibi interface.
Diffstat (limited to 'scheme/chibi/geiser/geiser.scm')
-rw-r--r--scheme/chibi/geiser/geiser.scm27
1 files changed, 27 insertions, 0 deletions
diff --git a/scheme/chibi/geiser/geiser.scm b/scheme/chibi/geiser/geiser.scm
index 96399c3..6ba3edd 100644
--- a/scheme/chibi/geiser/geiser.scm
+++ b/scheme/chibi/geiser/geiser.scm
@@ -1,3 +1,4 @@
+; -*- geiser-scheme-implementation:chibi; -*-
(define (all-environment-exports environment prefix)
(if environment
(append (filter (lambda (identifier)
@@ -92,3 +93,29 @@
(define (geiser:newline)
#f)
+;(define (geiser:symbol-location)
+ ; '("geiser-chibi-error" "Not implemented"))
+
+;;> A chibi implementation of the standard geiser's location-making
+;;> subrouting. \var{file} is a string representing file name with path,
+;;> \var{line} is the line number starting from 0 (scheme way).
+
+(define (make-location file line)
+ (list (cons "file" (if (string? file) file '()))
+ (cons "line" (if (number? line) (+ 1 line) '()))))
+
+;;> A function to find the file where the symbol
+;;> \var{symbol-representing-module} is defined.
+
+(define (geiser:module-location symbol-representing-module)
+ (make-location
+ (find-module-file
+ (module-name->file
+ (module-name
+ (find-module symbol-representing-module)
+ )
+ )
+ )
+ 0
+ )
+)