aboutsummaryrefslogtreecommitdiff
path: root/src/guile/skribilo/package/base.scm
diff options
context:
space:
mode:
authorLudovic Courtes2007-07-01 23:49:58 +0000
committerLudovic Courtes2007-07-01 23:49:58 +0000
commit518ed0ad7bdd7b1bb34360d5480c09bcbdffe5cd (patch)
tree81aac8ddff174a2d222b6fcaf13b09b138a910e2 /src/guile/skribilo/package/base.scm
parentb95946d78172644c42367addd03aa81f698caf3d (diff)
downloadskribilo-518ed0ad7bdd7b1bb34360d5480c09bcbdffe5cd.tar.gz
skribilo-518ed0ad7bdd7b1bb34360d5480c09bcbdffe5cd.tar.lz
skribilo-518ed0ad7bdd7b1bb34360d5480c09bcbdffe5cd.zip
Removed global hash tables for marks and program lines.
* src/guile/skribilo/package/base.scm (*mark-table*): Removed. (mark): Return the new mark without touching `*mark-table*'. Use `bs' as the mark's identifier. (ref)[mark-ref]: Simplified using `do-ident-ref'. [line-ref]: Use the new `resolve-line'. * src/guile/skribilo/prog.scm: Use `srfi-1'. (*lines*): Removed. (make-line-mark): Don't use `*lines*'. Removed `m' parameter. (resolve-line): Take an additional `doc' argument. (extract-string-mark): Fixed. (flat-lines): Use `concatenate' instead of `apply append'. (make-prog-body)[regexp]: Use brackets. Fixed invocation of `make-line-mark'. git-archimport-id: skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-132
Diffstat (limited to 'src/guile/skribilo/package/base.scm')
-rw-r--r--src/guile/skribilo/package/base.scm36
1 files changed, 6 insertions, 30 deletions
diff --git a/src/guile/skribilo/package/base.scm b/src/guile/skribilo/package/base.scm
index 9f6de43..872c1e2 100644
--- a/src/guile/skribilo/package/base.scm
+++ b/src/guile/skribilo/package/base.scm
@@ -1001,11 +1001,6 @@
(body (the-body opts))))
;*---------------------------------------------------------------------*/
-;* *mark-table* ... */
-;*---------------------------------------------------------------------*/
-(define *mark-table* (make-hash-table))
-
-;*---------------------------------------------------------------------*/
;* mark ... */
;* ------------------------------------------------------------- */
;* doc: */
@@ -1028,12 +1023,11 @@
(let* ((bs (ast->string bd))
(n (new markup
(markup 'mark)
- (ident (symbol->string (gensym bs)))
+ (ident bs)
(class class)
(loc &invocation-location)
(options (the-options opts :ident :class :text))
(body text))))
- (hash-set! *mark-table* bs n)
n)))))
;*---------------------------------------------------------------------*/
@@ -1154,25 +1148,7 @@
(ast s))))
(unref n text (or kind 'ident)))))))))
(define (mark-ref mark)
- (if (not (string? mark))
- (skribe-type-error 'mark "Illegal mark, " mark "string")
- (new unresolved
- (loc &invocation-location)
- (proc (lambda (n e env)
- (let ((s (hash-ref *mark-table* mark)))
- (if s
- (new markup
- (markup 'ref)
- (ident (symbol->string (gensym "mark-ref")))
- (class class)
- (loc &invocation-location)
- (required-options '(:text))
- (options `((kind mark)
- (mark ,mark)
- ,@(the-options opts :ident :class)))
- (body (new handle
- (ast s))))
- (unref n mark 'mark))))))))
+ (do-ident-ref mark 'mark))
(define (make-bib-ref v)
(let ((s (resolve-bib bib-table v)))
(if s
@@ -1214,17 +1190,17 @@
(new unresolved
(loc &invocation-location)
(proc (lambda (n e env)
- (let ((l (resolve-line line)))
- (if (pair? l)
+ (let ((l (resolve-line (ast-document n) line)))
+ (if l
(new markup
(markup 'line-ref)
(ident (symbol->string (gensym "line-ref")))
(class class)
(loc &invocation-location)
- (options `((:text ,(markup-ident (car l)))
+ (options `((:text ,(markup-ident l))
,@(the-options opts :ident :class)))
(body (new handle
- (ast (car l)))))
+ (ast l))))
(unref n line 'line)))))))
(let ((b (the-body opts)))
(if (not (null? b))