diff options
author | Ludovic Courtes | 2007-07-01 23:49:09 +0000 |
---|---|---|
committer | Ludovic Courtes | 2007-07-01 23:49:09 +0000 |
commit | 303200b9e863d2a1ff07180b5211a6826ea75f36 (patch) | |
tree | abaec35c81ace8e52a27e96f5a7269af5b79c2fb /src/guile | |
parent | 61d482a4b1e6e720f4607a4ebda3900c8e88c3b5 (diff) | |
download | skribilo-303200b9e863d2a1ff07180b5211a6826ea75f36.tar.gz skribilo-303200b9e863d2a1ff07180b5211a6826ea75f36.tar.lz skribilo-303200b9e863d2a1ff07180b5211a6826ea75f36.zip |
`base' package: Honor `:line #f' in `prog'.
* src/guile/skribilo/prog.scm: Use `srfi-11' instead of `receive'.
(make-prog-body): When creating a `&prog-line', set the `:number'
option only if `lnum-init' is true.
git-archimport-id: skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-130
Diffstat (limited to 'src/guile')
-rw-r--r-- | src/guile/skribilo/prog.scm | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/guile/skribilo/prog.scm b/src/guile/skribilo/prog.scm index 0113db6..9ea334d 100644 --- a/src/guile/skribilo/prog.scm +++ b/src/guile/skribilo/prog.scm @@ -1,7 +1,7 @@ ;;; prog.scm -- All the stuff for the prog markup ;;; -;;; Copyright 2003 Erick Gallesio - I3S-CNRS/ESSI <eg@essi.fr> -;;; Copyright 2006 Ludovic Courtès <ludovic.courtes@laas.fr> +;;; Copyright 2003 Erick Gallesio - I3S-CNRS/ESSI <eg@essi.fr> +;;; Copyright 2006, 2007 Ludovic Courtès <ludovic.courtes@laas.fr> ;;; ;;; ;;; This program is free software; you can redistribute it and/or modify @@ -21,7 +21,8 @@ (define-module (skribilo prog) :use-module (ice-9 regex) - :autoload (ice-9 receive) (receive) + :use-module (srfi srfi-11) + :use-module (skribilo lib) ;; `new' :use-module (skribilo ast) :use-module (skribilo utils syntax) @@ -32,11 +33,10 @@ (fluid-set! current-reader %skribilo-module-reader) -;;; ====================================================================== ;;; -;;; COMPATIBILITY +;;; Bigloo compatibility. ;;; -;;; ====================================================================== + (define pregexp-match string-match) (define pregexp-replace (lambda (rx str what) (regexp-substitute/global #f rx str @@ -54,7 +54,7 @@ ;*---------------------------------------------------------------------*/ ;* *lines* ... */ ;*---------------------------------------------------------------------*/ -;; FIXME: Removed that global. Rework the thing. +;; FIXME: Remove that global. Rework the thing. (define *lines* (make-hash-table)) ;*---------------------------------------------------------------------*/ @@ -99,14 +99,14 @@ (res '())) (if (null? ls) (values #f line) - (receive (m l) - (extract-mark (car ls) mark regexp) + (let-values (((m l) + (extract-mark (car ls) mark regexp))) (if (not m) (loop (cdr ls) (cons l res)) (values m (append (reverse! res) (cons l (cdr ls))))))))) ((node? line) - (receive (m l) - (extract-mark (node-body line) mark regexp) + (let-values (((m l) + (extract-mark (node-body line) mark regexp))) (if (not m) (values #f line) (begin @@ -200,17 +200,17 @@ lnum) (length lines))))) (let loop ((lines lines) - (lnum lnum) - (res '())) + (lnum lnum) + (res '())) (if (null? lines) (reverse! res) - (receive (m l) - (extract-mark (car lines) mark regexp) + (let-values (((m l) + (extract-mark (car lines) mark regexp))) (let* ((line-ident (symbol->string (gensym "&prog-line"))) (n (new markup (markup '&prog-line) (ident line-ident) - (options `((:number ,lnum))) + (options `((:number ,(and lnum-init lnum)))) (body (if m (make-line-mark m line-ident l) l))))) (loop (cdr lines) (+ lnum 1) |